Solved

Bold and Italics not rendering on page

Posted on 2013-12-12
16
380 Views
Last Modified: 2013-12-13
I have used both <B> <STRONG> <I> <EM> in <p> tag but it wont render in the browser as bold or italic.

The CSS designer is gone - can someone please help tell me what I need to do in the CSS to make it work

The Heading tags are bolding OK

Here is an example page where bolded and <em> text is not rendering properly

http://www.housecarers.com/why-not-to-board-pets.cfm

The CSS is main.css

Thank you for your help
0
Comment
Question by:Ian White
  • 4
  • 3
  • 3
  • +2
16 Comments
 
LVL 38

Expert Comment

by:Tom Beck
Comment Utility
You can remove font: inherit from reset.css on line 6.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
A bigger problem is that you don't have the BOLD or ITALIC versions of that web font so it will not display BOLD or ITALIC.  The standard fonts that you have on your computer like Arial and Times New Roman all come with Regular, Bold, Italic, and Bold-Italic versions.  If you want to do that with a web-font, you have to load those versions and instead of using <b> or <i>, you need to declare the appropriate Bold or Italic font.  Since you are loading the fonts thru the browser, it doesn't know to use the variations.  You have to do it explicitly.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
Comment Utility
If you want text inside your <em> tags to be bold, add this to your css (at the bottom so it overrides anything else).

em{font-weight: bold;}
0
 
LVL 42

Accepted Solution

by:
Chris Stanyon earned 500 total points
Comment Utility
Your problem is because you use a reset.css stylesheet to reset everything. This effectively removes all styling from all elements, so you can build your own from the ground up - that means you need to style your own strong tags:

Add this to your CSS and it'll work fine:

strong { font-weight:bold; }
b { font-weight:bold; }
em { font-style: italic; }
i { font-style: italic; }

Open in new window

A more modern approach is to use a normalizer stylesheet instead of a reset. This applies sensible defaults styles to all elements instead of removing them. It makes for a better starting point.

http://necolas.github.io/normalize.css/
0
 

Author Comment

by:Ian White
Comment Utility
I want <em> to be Italic not bold. I want <strong> to be bold

I am sorry I dont see the solution .. maybe I dont know enough. I want the web visitors to see bold and italiic that I markup.  Can someone please tell me in plain English the steps I need to take to make this happen like on most websites,  What do others do to get bold and itallic working.  sureley this is not hard.
0
 
LVL 42

Expert Comment

by:Chris Stanyon
Comment Utility
You really need to re-read through my previous comment. It explains why you have the problem and how to fix it. It also shows you exactly what you need to make <em> italic and <strong> bold!
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
Comment Utility
>I am sorry I dont see the solution
This is a good answer for what you want http:#a39716254

>Can someone please tell me in plain English the steps I need to take... maybe I dont know enough
If you are at the point where you don't understand http:#a39716254, then I suggest taking a few hours here http://www.codecademy.com/learn and click on the green Explore button in the Web Fundamentals box.  Several hours to learn the basics will save you more then ten fold as you work on your site.
0
 
LVL 38

Expert Comment

by:Tom Beck
Comment Utility
An even quicker solution is here if you just want a simple fix rather than actually learning anything.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
Comment Utility
>rather than actually learning anything.

There are multiple ways to get to the same visual outcome.  If you are going to be working on this kind of thing more than once, you should understand what you are doing.  Most the the problems we fix here are from copy and pasting code that was bad to begin with.    Just taking quick hits of advice and not really understanding what you are doing will lead to more troubles down the road.
0
 
LVL 38

Expert Comment

by:Tom Beck
Comment Utility
>if you are going to be working on this kind of thing more than once..

Why even make that assumption of the OP? Do you want to train everyone who posts a question to be a good web developer? Why?
 
Some people just want a quick solution.
0
 
LVL 42

Expert Comment

by:Chris Stanyon
Comment Utility
Do you want to train everyone who posts a question to be a good web developer? Why?

So in the future they can figure this stuff out on their own!

Look at the profile of the OP. 50 questions over 4 years, most regarding Web Development. So maybe education is the way to go.

Give a man a fish, he eats for a day. Teach a man to fish and he eats a lots of fish - or some thing like that ;)
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
As I pointed out above, you can't get BOLD or ITALIC if you don't have BOLD and ITALIC fonts installed.  The asker does not have them in his web-fonts.  Even in standard Windows fonts like Arial, BOLD and ITALIC are Separate fonts.  <b> and <i> only work if the BOLD and ITALIC fonts are installed where the programs know how to find them.
0
 

Author Comment

by:Ian White
Comment Utility
But <H3> tag you can see is bold on the sample page above . So BOLD is rendering for <h3> but not for <p>  You will see Bold for the headings but not for the P
0
 

Author Closing Comment

by:Ian White
Comment Utility
Aha ... Thanks that works.  Now I understand. Thank you for all your contributions from a one many business who must wear multiple hats. Yes I used to code Cobol and write JCL on a mainframe.  Hopefully this will help other novices coming along and looking. It is good to learn something every day.

I paid a lot of money to a designer to do this initially and they have gone and I need to maintain it. I will try the more modern approach when I have time - but for now the quick fix worked fine.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
The <H3> tag is Not bold, it is a different and larger font.  There are no <b> tags in that page at all.
0
 

Author Comment

by:Ian White
Comment Utility
Thanks - It worked by adding this to the CSS as is the accepted solution

Add this to your CSS and it'll work fine:

strong { font-weight:bold; }
b { font-weight:bold; }
em { font-style: italic; }
i { font-style: italic; }

The reset was removing these defaults and the designer never used them - now I need them.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now