[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How do I highlight text in HTML as bold ?

Posted on 2013-01-08
11
Medium Priority
?
344 Views
Last Modified: 2013-01-08
Hi,
I'm trying to highlight text on a web page in a bold font but despite using the HTML <B> tag it doesn't render on the page.
I'm using CSS to create the page and its elements in a stylesheet as follows :

p {
font-family: Calibri, Arial, Helvetica, sans-serif;
font-size:14px;
font-weight:lighter;
color:#333333;
}

In my HTML page my script looks as follows :

<p>The most important feature is <b>the primary case</b></p>

But the bold tag doesn't render in IE8.

How do I create an inline style for this text item ?

Many thanks
Toco
0
Comment
Question by:Tocogroup
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 25

Accepted Solution

by:
Kyle Hamilton earned 2000 total points
ID: 38756977
instead of <b> which is deprecated, use <strong>. you can also specify rules for strong in your css

strong{
font-weight:bold;
color:#000;
}
0
 

Author Closing Comment

by:Tocogroup
ID: 38757005
Excellent !
Thank you very much

PS I must really update my HTML knowledge !
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 38757056
The bold tag <b> works fine in IE8... unless someone has redefined it.  I maintain a couple of web sites where that has been done and it is very irritating to work around where someone has 'redefined' standard tags.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 12

Expert Comment

by:tel2
ID: 38757108
Hi Dave,

When you say "redefined', you're talking via CSS, right?  (I don't know of any other way, but HTML is not my specialty.)

Yes, it's irritating when someone redefines such tags.  Maybe they think "this tag is deprecated, so I'll make sure it can't be used (as it previously could be) anymore, forcing people to do it the new ways".  8(
0
 
LVL 25

Expert Comment

by:Kyle Hamilton
ID: 38757201
there is no reason to believe that the b tag in this instance was redefined. and yes, in ie 8 it should work.

its still better to bring your html up to date, and there is nothing wrong with specifying custum rules for existing tags. thats what css is for. if the b tag was redefined not to your liking you can always find the rules very quickly with firebug or whatever tool of your preference.

not a big deal.
0
 
LVL 12

Expert Comment

by:tel2
ID: 38757230
Hi kozaiwaniec,

Good points, but...
> there is no reason to believe that the b tag in this instance was redefined. and yes, in ie 8 it should work.

If it hasn't been redefined, then why else do you think IE 8 (or whatever) might not render it in the default way?
0
 
LVL 25

Expert Comment

by:Kyle Hamilton
ID: 38757257
who knows... could be lots of things - without seeing the page I couldn't tell you

doctype, scripts, invalid markup, other errors... ???
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 38757390
Yes, via CSS.  The sites I was talking about having this master CSS file that redefines a number of things.  I can only suppose it was another case of a 'clever' developer making life difficult for anyone who replaced him.
0
 
LVL 25

Expert Comment

by:Kyle Hamilton
ID: 38757426
Dave,

are you talking about a "reset" file? Sometimes there's good stuff in those that normalizes appearance across browsers - especially form elements. But I agree, not everything - you have to cherry pick.
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 38757501
Nope, not an Eric Meyer reset.  The owner of the website likes including the CSS file even very little of it is being used.  Here's the first few lines.  Some is normal, some a little odd.  I would not normally (outside of a reset) universally define things this way.  There are id's and classes in the rest of the file but it is not particularly organized.  I think someone just found this somewhere and decided it was "A Good Thing".
body {background-color:#FFFFFF;margin:0}
body, td, table, input, select, textarea, div {color:#111111;font-family:verdana,arial,sans-serif;font-size:9px;}
form {margin:0;}
input {padding:0px;font-size:9px;}
a:link, a:visited {color:#333333;text-decoration:none;}
a:hover {text-decoration:underline;}
b {font-weight:normal;}
img {border:0}
img.block {display:block;}
ul {margin:0; padding:4px 0 5px 0;}

Open in new window

0
 
LVL 25

Expert Comment

by:Kyle Hamilton
ID: 38757574
yeah, that doesn't look like a reset.

the most egregious stuff in that set would be the b{ font-weight: normal}, because it's counter intuitive, and the very specific padding on something as global as a ul. The other stuff is understandable - though it depends on wether the site design really follows those rules.

I guess sometimes people take an existing code base and tweak it, cause they don't know how to start from scratch. But what's worse, they don't understand what they're tweaking. oh well...
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

656 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