probably a pretty easy question but how do I create a div that work like how the <b> tag works?
I wanted to remove the <b> tags from the my html so I replaced them with <div style='font-style:bold;'>bold</div> . But after doing this the divs kept breaking the text into a new line. does anybody know how to fix this?
how do I create a inline div
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Try:
Mac
Code: Select all
<div style="font-weight: bold;">bold</div>no
that doesn't work I already know how to bold the text. run/look at how the below turns out I want to prevent that linebreak
Code: Select all
<HTML>
<BODY>
jhfjfd gkljfdhf djklhg f ldkhdglkfd lgk lkfdh glk fdlkg lkfd dflk ghlfdk lfd f<div style="font-weight: bold;">bold</div>fdjhvfdghfdkjgdfkj fdfdkjh fdkj dfkjh fdkj dfkjh dfkjh dfkjh fdjkhfdjkh fdjkh fdkj dfkjh dfkjhdfk
fdkjhdfkjhdfkjhdf
fdkjdfhkjdfhkjfdhkjfdhkjdfhfdjk
</BODY>
</HTML>it's fixed
yes, it works now
- thanx nielsene
the <div> deletes the spaces after the </div> tag but the span doesn't whats the deference between a <div> and a <span> tag?
Code: Select all
<HTML>
<BODY>
jhfjfd gkljfdhf djklhg f ldkhdglkfd lgk lkfdh glk fdlkg lkfd dflk ghlfdk lfd f <div style="font-weight: bold;display: inline;">bold </div> fdjhvfdghfdkjgdfkj fdfdkjh fdkj dfkjh fdkj dfkjh dfkjh dfkjh fdjkhfdjkh fdjkh fdkj dfkjh dfkjhdfk
fdkjhdfkjhdfkjhdf
fdkjdfhkjdfhkjfdhkjfdhkjdfhfdjk
</BODY>
</HTML>Inline Div?
You might be better off using a class or span as indicated above. A Div is used to define block elements and should not really be used in the fashion you are using it in. 