Forum Moderators: not2easy

Message Too Old, No Replies

BOLD text

how to make just the "welcome" bold

         

dugdev

8:49 pm on May 6, 2014 (gmt 0)

10+ Year Member Top Contributors Of The Month



I'm trying to make the words "40 years of Memories" bolder (thicker) than the rest of the text but i can only make ALL the text bold or none of it. i think it's because i have 2
<P class="block"> tags under the <body> section.
I tried removing the 2nd one but then i lost all the "styling"
for the rest of the text..... how do i fix this?.

The code under <style> is:-
p.block {width: 955px; margin: 0 auto; background-color: black; color: white; padding: 10px; text-align: justify;}

the code under <body> is:-
<P class="block">40 Years of Memories</p><br>
<P class="block">In 1974 Just after blah blah blah.

THANKS

LifeinAsia

9:07 pm on May 6, 2014 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



If you apply the same style to 2 blocks of text, both blocks will obviously have the same styling.

Quick and dirty, this should work:
p.blockb {width: 955px; margin: 0 auto; background-color: black; color: white; padding: 10px; text-align: justify; font-weight:bold;}

<P class="blockb">40 Years of Memories</p><br>

dugdev

9:15 pm on May 6, 2014 (gmt 0)

10+ Year Member Top Contributors Of The Month



@LifeinAsia..... Hi......appreciate you taking time to reply.

and YESSSSSSS.... spot-on, it worked :-D

Many thanks

lucy24

9:22 pm on May 6, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Y'know, there are times when you really don't need to go beyond simple html. Why don't you simply wrap the text in <b> tags?

Incidentally, why is this a <p>? From context, it seems more like some level of header. Not <h1>, of course, but something further along.

:: wait, stop, rewind ::

Oh, hi dugdev, it's you. I'd recognize that white-on-black anywhere ;)

</p><br> is redundant. If you want extra space between the two paragraphs, put it in the css either as margin-bottom for the first element or margin-top for the second one.

Now, once you've got multiple text blocks in the same area, wouldn't it make more sense to go back and make the whole thing into a div with those colors?

div.block {width: 955px; margin: 0 auto; background-color: black; color: white; padding: 0;}
div.block p {text-align: justify; margin: .5em auto 0; padding: 0 10px;}

unless there's anything in this center column that should not have a black background. Set the width to the exact width of the images, and the paragraphs inside the block will automatically be the right width.

But it still feels like a header. Heading. Whatever the ### it is that <h> stands for.

h3 {font-size: 108%; text-align: center; margin-bottom: 2em; font-weight: bold;}
or, if necessary,
div.block h3 et cetera.

It happens that "bold" is the default formatting of headers in html. But you should never leave this kind of thing to chance. My own boilerplate says something like
h1, h2, h3, h4, h5, h6 {text-align: center; line-height: 1.5; font-weight: normal; font-style: normal; margin: 1em auto .5em;}

and then the individual heading/header/headbzzzt levels get set as needed.

dugdev

9:46 pm on May 6, 2014 (gmt 0)

10+ Year Member Top Contributors Of The Month



YEAHHHHHHH Lucy:-)...... it IS the TEXT that ONLY has the black box. lolol

Ohhhhhhhhhhhhh..... i think i just understood the div block comment. i was wondering why the images are sitting inside a dotted line box but the text is'nt.

I've been busy collating images that i want to use on the website. I'm now gonna go back and redo the page but stripe the styling out and put it onto a stylesheet..... should make life more straightforward........i hope:-D

lucy24

10:37 pm on May 6, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



it IS the TEXT that ONLY has the black box.

Are there supposed to be visible gaps between the pictures and/or between picture and text block? That is, areas that you want to be grey rather than black? I'm asking now about top-to-bottom space. I know there will be grey to either side unless your window happens to be narrower than 955 pixels.

i was wondering why the images are sitting inside a dotted line box but the text isn't.

Uh-oh. Where did the dotted line come from? We didn't add a border at some point, did we? Some browsers may add visible table borders if you don't tell them not to, but there's no default formatting for a div. (Or for a span. They're both just armatures to hang your css on.)


for those of you just joining us:
here [webmasterworld.com] is the previous thread.

dugdev

8:04 am on May 7, 2014 (gmt 0)

10+ Year Member Top Contributors Of The Month



Nope defo no boarders......
and YES there are gaps between the images and text box and above the 1st image and below the last image

I should have said,re your previous cooment, i actually also understood about h1, h2's etc....:-DE