Post: Need Help
03-08-2016, 12:30 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); So I want to edit the Introduction and the Summary and change the font-weight to bold. I know i can use the <strong> tags but i want to do this in CSS and when i try, it changes everything to bold. What do I do? They are both outside the <div> so is there a way I can access them directly?

    <!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
<title>Ultimate Text Challenge</title>
</head>
<body>
<p>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>
(adsbygoogle = window.adsbygoogle || []).push({});
03-08-2016, 12:33 PM #2
Toxic
former staff
Originally posted by HipHopSizz View Post
So I want to edit the Introduction and the Summary and change the font-weight to bold. I know i can use the <strong> tags but i want to do this in CSS and when i try, it changes everything to bold. What do I do? They are both outside the <div> so is there a way I can access them directly?

    <!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="https://www.nextgenupdate.com/forums/stylesheet.css"/>
<title>Ultimate Text Challenge</title>
</head>
<body>
<p>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>


just use <b> in html for bold, or font-weight: bold; in css
now for the second issue, give the element an id or a class, then access it in CSS by doing .ELEMENTCLASSNAME, or #ELEMENTIDNAME Winky Winky

The following user thanked Toxic for this useful post:

HipHopz
03-08-2016, 12:42 PM #3
Originally posted by Habibi
just use <b> in html for bold, or font-weight: bold; in css
now for the second issue, give the element an id or a class, then access it in CSS by doing .ELEMENTCLASSNAME, or #ELEMENTIDNAME Winky Winky


Originally posted by HipHopSizz View Post
So I want to edit the Introduction and the Summary and change the font-weight to bold. I know i can use the <strong> tags but i want to do this in CSS and when i try, it changes everything to bold. What do I do? They are both outside the <div> so is there a way I can access them directly?

    <!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="https://www.nextgenupdate.com/forums/stylesheet.css"/>
<title>Ultimate Text Challenge</title>
</head>
<body>
<p>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>


<b>, <strong> are outdated. it's preferable to use the in-text css method, such as <div style="font-weight:bold;"></div>
03-08-2016, 12:43 PM #4
Toxic
former staff
Originally posted by Frosty View Post
<b>, <strong> are outdated. it's preferable to use the in-text css method, such as <div style="font-weight:bold;"></div>


he dont want to change the whole div's contents :madsal:
and i said what you said for the css method Sal
03-08-2016, 12:48 PM #5
Originally posted by Habibi
he dont want to change the whole div's contents :madsal:
and i said what you said for the css method Sal


I see, then he'd just a p css, no class needed.

Like so:

    
p
{
font-weight:bold;
}


so that all content within <p></p> tags are bold, without adding in-text css, or a class.
03-08-2016, 12:49 PM #6
Toxic
former staff
Originally posted by Frosty View Post
I see, then he'd just a p css, no class needed.

Like so:

    
p
{
font-weight:bold;
}


so that all content within <p></p> tags are bold, without adding in-text css, or a class.


yes but that'll change all the p's to bold tears which of course he doesnt want to
03-08-2016, 12:53 PM #7
Originally posted by Habibi
yes but that'll change all the p's to bold tears which of course he doesnt want to


Hmm failed to notice there are p tags inside the div. Class would be ideal then.
03-09-2016, 11:08 PM #8
Specter
Pro Memer
Question seems to be answered, I'm going to go ahead and close this.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo