Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting a style within text

Status
Not open for further replies.

DeepBlerg

Technical User
Jan 13, 2001
224
AU
Hi,

How do I set a style to certain bits of text without using <p> tags.

<style=&quot;header&quot;>hello</style> doesn't seem to work.

Thanks.
 
you need to put the style attribute in a tag. The style tag is used for defining styles in a style block. The most useful for tag for you to apply the style to is span though you could use any in theory. try this


<span style=&quot;font-weight:bold&quot;>hello</span> how are you

or alternaitevly you could use a class

<span class=&quot;header&quot;>hello</span> how are you

and then define your class in a style block or external css like this
<style>
.header{font-weight:bold}
</style>

hope this helps

rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top