Avatar of Ian White
Ian WhiteFlag for Australia

asked on 

Bold and Italics not rendering on page

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
CSSHTMLCOBOL

Avatar of undefined
Last Comment
Ian White
Avatar of Tom Beck
Tom Beck
Flag of United States of America image

You can remove font: inherit from reset.css on line 6.
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

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.
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

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;}
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Ian White
Ian White
Flag of Australia image

ASKER

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.
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

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!
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

>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.
Avatar of Tom Beck
Tom Beck
Flag of United States of America image

An even quicker solution is here if you just want a simple fix rather than actually learning anything.
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

>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.
Avatar of Tom Beck
Tom Beck
Flag of United States of America image

>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.
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

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 ;)
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

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.
Avatar of Ian White
Ian White
Flag of Australia image

ASKER

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
Avatar of Ian White
Ian White
Flag of Australia image

ASKER

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.
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

The <H3> tag is Not bold, it is a different and larger font.  There are no <b> tags in that page at all.
Avatar of Ian White
Ian White
Flag of Australia image

ASKER

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.
HTML
HTML

HTML (HyperText Markup Language) is the main markup language for creating web pages and other information to be displayed in a web browser, providing both the structure and content for what is sent from a web server through the use of tags. The current implementation of the HTML specification is HTML5.

62K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo