Forum Moderators: not2easy

Message Too Old, No Replies

Problem with going bold

bold

         

Charlotte

12:15 pm on Feb 4, 2004 (gmt 0)

10+ Year Member



I'm having a problem with making default text bold. All the attributes (if that's the right word) are the same as they are for the default text but when I add "font-weight: bold;" and apply it to the text, the text shrinks in size and doesn't look like the original text.
Am I being dense and missing something really obvious?!

.default_text {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; color: #000000; line-height: 20px}

.defaulttextbold {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; color: #000000; line-height: 20px; font-weight: bold; }

Thanks for any help.

jetboy_70

12:31 pm on Feb 4, 2004 (gmt 0)

10+ Year Member



Hi Charlotte,

Welcome to Webmasterworld. :)

Ditch the second class, and instead use:

.default_text b { font-weight: bold; }

This will affect any text defined as 'default_text' inside <b> tags.

Charlotte

1:19 pm on Feb 4, 2004 (gmt 0)

10+ Year Member



Hi. Thanks. I meant to say "hello, new to this etc" in my first post but got carried away!
So hi, I'm kind of new to all this and am using and adding to a style sheet I inherited from someone else. Most of it works fine except for this darned "bold" business.

I tried your suggestion but whenever I save a style, I can't have spaces (is that right?).
So I tried "default_textb" instead and that just bolded (if that's a word) the text and not in the font I'm after....

choster

2:32 pm on Feb 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you want to make default text bold for the whole page, IMHO you're better off assigning the weight declaration in a tag rule instead of a class, such as:
html, body, td, p, li {font-weight:bold}

the text shrinks in size and doesn't look like the original text.
How exactly do you mean shrink? Large amounts of bold text will look very different from normal text; you may need to readjust your font sizes to compensate. If you provide a short snippet of your HTML code, we might be able to identify some other style which might be interfering or overriding your other preferences.

whenever I save a style, I can't have spaces

It depends what you're trying to do. You can't have spaces in a class or id name. But spaces are essential for other CSS syntax, .

The example jetboy_70 gave was to select for text inside a <b> tag inside of another element with the class "default_text" assigned, for instance

<style type="text/css">
b {font-weight:normal}
p.default_text b {font-weight:bold}
</style>
[...]
<p><b>This text is not bold</b></p>
<p class="default_text"><b>This text is bold</b>.</p>

[edited by: choster at 2:57 pm (utc) on Feb. 4, 2004]

jetboy_70

2:53 pm on Feb 4, 2004 (gmt 0)

10+ Year Member



"whenever I save a style, I can't have spaces"

Using Dreamweaver by any chance? You'll need to edit the CSS be hand.

Charlotte

3:22 pm on Feb 4, 2004 (gmt 0)

10+ Year Member



I just knew I've only been swimming about on the surface so far - maybe even just testing the water with a toe.
"Spaces are essential for other CSS syntax"?
I think that's something I need to read more about. I've only been using CSS for fonts.

Re coding, I am indeed using Dreamweaver but when I work on the style sheet, I'm hand coding.

Here's a snippet using the default_text and defaulttextbold things I posted above (I'm testing the look with non-CSS fonts and there's a def difference in look between the CSS bold and the normal bold):

<span class="default_text">default text<br></span>
<span class="defaulttextbold">default text bold</span>
<br>
<strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">default text bold not</font></strong></p>
<span class="defaulttextbold">
blah blah - default text bold</span> <p><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">not default text bold - verdana 2 bold </font></strong></p>

jetboy_70

4:31 pm on Feb 4, 2004 (gmt 0)

10+ Year Member



Oh dear.

Okay, size 2 is not the same as CSS size 12px. 13px is closer, and bold 13px Verdana should look the same as size 2 bold Verdana (at least in IE).

Charlotte

11:17 am on Feb 5, 2004 (gmt 0)

10+ Year Member



Thanks. 13 px looks better.

choster

3:56 pm on Feb 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Charlotte, I really would avoid mixing CSS definitions and <font> tags if at all possible (and preferring the CSS). <font size="2"> may look like Verdana 13px on your machine, but what if someone has their default Internet Explorer text size set to small insted of medium, or is using a different browser which rounds up instead of down or vice versa and so renders a slightly different size? Consistency will also make it easier to debug style conflicts or browser-specific problems.

Charlotte

9:24 am on Feb 6, 2004 (gmt 0)

10+ Year Member



I am sticking to CSS styles only and avoiding font styles. I was just using the Verdana, Size 2 etc text as a comparison. I'm not really using it on the web page. It may seem like I really don't know what I'm doing but I know a little!
Thanks though. :-)