Question about another way to do 8


#1

https://www.codecademy.com/courses/web-beginner-en-WF0CF/1/4?curriculum_id=50579fb998b470000202dc8b#


I've passed the exercise, but I was wondering if there was a way to do the formatting using only the CSS stylesheet?In particular, for step 2, is there a way to target just the introduction paragraph by just using the stylesheet.css?

Edit: Also it appears to pass you even if you forget to format the summary paragraph.

Edit#2: Posted the code that I used for it to pass.

<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
		<title>Ultimate Text Challenge</title>
	</head>
	<body>
		<p style="font-weight: bold">Introduction: Cascading with CSS</p>
		<div>
			<p>Synopsis: When you set a property of a selector like 'p' to a certain value, that value applies to <em>all</em> p tags.
			If, however, you change that same property to a different value for a more specific instance of p,
			that change will <em>override</em> the 'general rule'.
			</p>
			<ul>
				<li><p>If you say p { font-family: Garamond}, all 'p's will have the font Garamond.</p></li>
				<li><p>BUT if you say li p {font-family: Verdana}, 'p's outside of 'li's will be
					   in Garamond, and 'p's INSIDE 'li's will be in Verdana.
				</p></li>
				<li><p>The more specific your selectors are, the higher importance CSS gives to the styling you apply!</p></li>
			</ul>
		</div>
		<p>Summary: Greater specificity makes CSS prioritize that particular styling.</p>
	</body>
</html>


/*Add your CSS below!*/

p {
    font-family: Garamond;
}

li > p {
    color: #000000;
    text-decoration: underline;
}

div > p {
    color: #7ac5cd;
}


#2

Did you not add

 body > p {
 font-weight: bold;
 }

to the stylesheet to pass the exercise? Also, the above is how you'd target the introductory and closing paragraph using the stylesheet.


#3

step 2 says to target both the introduction and summary paragraph, which are both direct children of body, you can use @ghughes13 method

We can't see what you wrote for css code unless you post it to the forum


#4

Edited the main post. Code's there now. I think I answered my own question though. Wasn't fully understanding the lesson.:sweat_smile:


#5

Hm.. weird it missed that you didn't make the introduction and summary paragraph, as you understand it now everything is fine :slight_smile:


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.