HTML Code:
<!doctype html>
<html>
<head>
<title>HTML CSS Exercise - Style first letter and first line</title><!-- Set the title of the HTML page -->
<style type="text/css">
/* CSS styles start here */
.container{
width:500px; /* Set the width of the container */
}
p::first-letter{
color: #4b6c9c; /* Set the color of the first letter of paragraphs */
font-weight:bold; /* Set the font weight of the first letter to bold */
font-size:150%; /* Set the font size of the first letter to 150% of the parent font size */
}
p::first-line{
color: #5ac4ed; /* Set the color of the first line of paragraphs */
}
/* CSS styles end here */
</style>
</head>
<body>
<div class="container"><!-- Create a container div for content -->
<p>In 1986 the Defense Advanced Research Projects Agency (DARPA), the Army Research Office (ARO), the National Science Foundation (NSF), and ESL, Inc sponsored Berkeley POSTGRES Project which was led by Michael Stonebraker.</p><!-- Add a paragraph with text inside the container -->
</div>
</body>
</html>
Explanation:
Live Demo :
See the Pen style-first-letter-and-first-line-answer by w3resource (@w3resource) on CodePen.
Supported browser
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4