Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 10-02-2009
Member
 
Join Date: Feb 2009
Posts: 62
Add Bold and Italics to Text in CSS

I am still learning CSS but have a concept of it for the moment. I needed to add bold and italics to my text so I added <b> and <i> tags and gave them each their own entry in the CSS style sheet file:

Code:
b {
font-style:bold;
}
Doing this also made me fail the CSS certification too.To make a word bold, I currently have it like this: <p><b>bold text</b></p>. So what am I doing wrong here and how do I make it more proper. I read that <strong> and <em> tags were on the way out but have been told otherwise recently. You may be having an idea if you have seen the page of any web site which provide this kind of layout and can suggest me where can I use both currently.
Reply With Quote
  #2  
Old 10-02-2009
Member
 
Join Date: Dec 2008
Posts: 183
Re: Add Bold and Italics to Text in CSS

The ?bold? and ?italic? HyperText Markup Language (HTML) elements, expressed as <b> and <i>, respectively, aren?t illegal. In fact they?re legal to use and have distinct semantic purposes. Whether to use them or not should be dictated by said purposes, and nothing else.That would be a presentational thing and that?s what your Cascading Style Sheet (CSS) is for.

Now while it is very difficult to explored the semantic meaning of the bold and italic elements, I will say this now, ?b? does not mean strong emphasis or importance; that?s what the ?strong? element, written as <strong>, is for. I will also state that ?i? does not indicate light emphasis, that?s what the ?em? element, written as <em>, is for.
Reply With Quote
  #3  
Old 10-02-2009
Member
 
Join Date: Oct 2008
Posts: 167
Re: Add Bold and Italics to Text in CSS

Yes, it's true that in the bad old days, programmers used the <strong> and <em> tags to mark headers, and yes it's true that that should stop (and should have stopped some years ago). If you're making a header, use a header tag, and use CSS (not <strong> and <em> tags) to define the visual appearance of your header.

But <strong> and <em> have a proper use as content-bearing tags. The use of bold and italics is as intrinsic to the writing process as the use of all-caps was before bold and italics came on the scene. The <strong> and <em> tags, correctly used, are not formatting tags. They are content tags.

we define the Testimonial class in our CSS file as follows :

Code:
span.Testimonial
{
font-style:italic;
}
Add another definition to the CSS file :

Code:
span.Testimonial i
{
font-style:normal;
}
Reply With Quote
  #4  
Old 10-02-2009
Member
 
Join Date: Dec 2008
Posts: 70
Re: Add Bold and Italics to Text in CSS

I had previously believed that both bold and italic were given extra weight, checking the authority reveals that only bold (and larger font) is given weight.

I would assume that the developers realized fully well that <strong> and <b>, while conceptually distinct, are similar enough to be treated similarly. As far as we know currently Google ignores css.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Add Bold and Italics to Text in CSS"
Thread Thread Starter Forum Replies Last Post
Getting unwanted bold text after saving as a PDF from Photoshop Valan Windows Software 9 13-11-2011 03:51 PM
Safari-All texts in italics GunPower Technology & Internet 6 16-06-2011 08:28 PM
Fonts are displayed in italics in IE8 Shikamaru Nara Technology & Internet 5 15-04-2011 11:22 AM
internet explorer-9 has the default font as italics Siketan Technology & Internet 5 16-03-2011 10:02 PM
Why Internet-fonts have turned italics? Faakhir Technology & Internet 3 02-03-2009 11:28 AM


All times are GMT +5.5. The time now is 03:06 AM.