The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Web Design
> CSS Help
|
simple css question
Discuss simple css question in the CSS Help forum on Dev Shed. simple css question Cascading Style Sheets (CSS) forum discussing all levels of CSS, including CSS1, CSS2 and CSS Positioning. CSS provides a robust way of applying standardized design concepts to your web pages.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

April 21st, 2003, 06:17 PM
|
|
Contributing User
|
|
Join Date: Sep 2002
Posts: 62
Time spent in forums: 1 h 46 m 42 sec
Reputation Power: 11
|
|
|
simple css question
scenario: i applied some styles to the p (paragraph) tag, so text in a paragraph is a certain color and size and whatever. however when i attempt to put a word within the bold tag (<b>), nothing happens, the text i want to be bold is unaffected (its not bold like i want it to be). do you have to use a work around when it comes to making text bold in css? thanksNadvance
|

April 21st, 2003, 07:43 PM
|
 |
mod_dev_shed
|
|
Join Date: Sep 2002
Location: Atlanta, GA
|
|
Well, since you're using CSS, you should't be using the <b> tag anyway b/c it's a formatting/style tag. Instead, use a <span> tag and apply a class to it and add that class to your stylesheet. That way, in the future, if you no longer want the words bold, but maybe italic instead, you can change just the stylesheet. After all, that is the advantage.
Code:
<style type="text/css">
p
{
color: red;
font-size: 1em;
}
.keyword
{
font-weight: bold;
}
</style>
Code:
<p>This is some a <span class="keyword">keyword</span>, which is bold!</p>
|

April 22nd, 2003, 12:47 AM
|
|
Contributing User
|
|
Join Date: Sep 2002
Posts: 62
Time spent in forums: 1 h 46 m 42 sec
Reputation Power: 11
|
|
|
thanks jharnois,
actually i never heard of the span tag, is it a generic tag meant to be applied to miscelaneous styles?
|

April 22nd, 2003, 01:38 PM
|
 |
mod_dev_shed
|
|
Join Date: Sep 2002
Location: Atlanta, GA
|
|
|
It's an inline tag whereas <p> is a block tag.
|

April 22nd, 2003, 02:37 PM
|
 |
This is only a test
|
|
Join Date: Mar 2003
Location: Off the air
|
|
|
<span> is a tag that's meant only for carrying style information; it has no effect on its own. When you stick a style into a <div> tag, for example, you get the style information and the extra line break from <div>'s normal function. <span> doesn't have a normal function like that, so you can use it without it changing anything else.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|