tags:

views:

308

answers:

7

Hi Friends,

I don't make anything particular. I use Safari, and when I use <strong>blabla</strong> it doesn't work, but <b>blbla</b> does. any idea about what can be the reason?

Regards...

I use Yahoo Reset.css, if it may cause the problem.


sample code:

<p><strong>Address:</strong> bla bla bla blaabllb</p>
+1  A: 

It can be that the browser has somehow lost default settings for the "strong" element.

Try to make it "recall" by specifying it explicitly in your CSS:

strong
{
    font-weight: bold;
}
Developer Art
It's not the browser, it's the Yahoo reset CSS - it removes all formatting, including from STRONG/EM.
ceejayoz
yes, for sure this is going to work. but why do we need to do that? :/ why doesnt <strong> take affect itself?
artmania
I cleared all definitions about <strong> in reset.css but still same.
artmania
Because <strong> is nothing more than an HTML entity that is predefined to make text bold. You can redefine it to have any other effect you like.
Developer Art
A: 

Well it all depends on what the CSS is doing.

strong {
    font-weight:bold;
}

will make it appear bold. Some browsers will have that set as a default CSS rule, others might not. Have you set anything that says explicitly that strong or <b> will result in bold text?

Generally you shouldn't rely on the browsers to style elements on their own. For example, Safari might say:

strong {
    font-weight:bold;
    font-size: 1.2em;
}

while Firefox may have:

strong {
    font-weight:bold;
    color: #000000;
    font-size: 18px;
}

or something like that. So when different users view your page, it may or may not look the same.

Investigate reset.css files (maybe here) and think about telling the browser WHAT you want it to look like via CSS.

Alex Mcp
A: 

You shouldn't use the tags "strong" and "b" to achieve just bold text. Instead use stylesheets to make text appear bold and only use strong if you want to emphasize something. You can also use stylesheets to make strong appear bold in safari.

Mobbit
A: 

Do you have strong declared in your css file? if you have a declaration:

strong{}

then nothing will happen.

You need to have:

strong{
font-weight:bold;
font-style: italic;
}
lilott8
+6  A: 

Yahoo's reset.css has this:

address,caption,cite,code,dfn,em,strong,th,var { 
    font-style:normal; 
    font-weight:normal; 
}

This indeed means that it won't be bold.

reko_t
+11  A: 

Yes, the Yahoo! CSS reset removes formatting from STRONG tags (as well as all other tags).

You'll need to explicitly declare the formatting as noted in the other answers...

strong { font-weight: bold; }

The Firefox plugin Firebug will let you right-click on an element and say "Inspect Element", which among other things displays what CSS has been applied to that element and from what stylesheet that CSS comes. Very helpful for running down what's causing an issue like this.

ceejayoz
A: 

<strong> is a semantic element used to emphasize the enclosed text, while <b> (though "deprecated") is more of a typographic convention.

strong {font-weight:bold}
Typeoneerror
Safari applies a default bold formatting to `strong` just like every other major browser. It's the Yahoo CSS reset that's the issue.
ceejayoz