element - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:element

Description

The element selector selects elements with the specified element name.

Example

Select and style all <p> elements:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
p {<!--from   w ww  . ja v  a  2  s . c om-->
    background-color: yellow;
}
</style>
</head>
<body>

<h1>Welcome to My Homepage</h1>

<div>
  <p id="myId">this is a test.</p>
  <p id="myElement">this is a paragraph.</p>
</div>

<p>I <b>like</b> css.</p>

</body>
</html>

Related Tutorials