Changing text in CSS

liunx

Guest
Anyone know how I can get the text within H1 of this example to disregard the values in rule H1 and adopt the values in t?<br />
I don't want to start a new header or paragraph for the text because I want it to stay on the same line as SITENAME.com.<br />
<br />
<br />
H1 { white-space : nowrap; color: white; font-size: 50px; font-family: impact }<br />
<br />
H2 { white-space : nowrap; text-indent: 30px; position: justify; left:1px; top: 1px; color: white; font-size: 20px; font-weight: bold; font-family: impact; line-height: 19px; border: 3px double orange }<br />
p {white-space : nowrap; color: yellow; font-size: 20px; font-style: italic; font-weight: bold; border: 3px double orange } <br />
i { color: white; font-size: 15px }<br />
t { color: yellow; font-size: 15px }<br />
--><br />
</STYLE></HEAD><br />
<BODY BGCOLOR="#000000"><br />
<H1><a href=http://www.webdeveloper.com/forum/archive/index.php/"C:\My Documents\link.html">SITENAME.COM</a>&nbsP;</t>This is the text I want to change.</t></H1><!--content-->Use a <span> tag.<br />
<br />
<style type="text/css"><br />
<!--<br />
h1 {properties}<br />
#t {properties}<br />
--><br />
</style><br />
...<br />
<h1>Text<span id="t">Text</span>Text</h1><!--content-->Originally posted by mike444 <br />
<br />
I don't want to start a new header or paragraph for the text because I want it to stay on the same line as SITENAME.com.<br />
<br />
<br />
If it is NOT a part of the heading, it should NOT be inside the <hx>.<br />
<br />
For your desired effect try eg this<br />
<br />
<div><br />
<h1>blabla</h1><br />
<span>Text on the same line</span><br />
</div><br />
<br />
h1 {display:inline;}<!--content-->Originally posted by Zach Elfers <br />
Use a <span> tag.<br />
<br />
<style type="text/css"><br />
<!--<br />
h1 {properties}<br />
#t {properties}<br />
--><br />
</style><br />
...<br />
<h1>Text<span id="t">Text</span>Text</h1> <br />
<br />
this did the trick! Thanks! <br />
<br />
Stefan, will try. Thanks!<!--content-->Originally posted by mike444 <br />
Stefan, will try. Thanks! <br />
For the benefit of those who didn't understand the difference between Zach's and Stefan's suggestions:<br />
<br />
<h1>SITENAME.COM <span class="t">This is the text I want to change</span></h1><br />
<br />
<div><h1>SITENAME.COM</h1> <span class="t">This is the text I want to change</span></div><br />
<br />
In the first example, "SITENAME.COM This is the text I want to change" is the page heading.<br />
<br />
In the second example, "SITENAME.COM" is the page heading. "This is the text I want to change" is just text that appears besides the heading.<br />
<br />
On a visual browser, the two look exactly the same. But the markups have different meanings: One where "This is the text I want to change" is a part of the heading, and other where it isn't. This will make a lot of difference in non-visual browsers (lynx, braille, handhelds, and possibly the most important - search engines). You need to decide for yourself if the text deserves an <h1>, or <span> or maybe its a subheading and deserves an <h2>. In the final case, add {diaplay: inline} in styles for h2 too.<!--content-->My guess is the problem is in the way I'm formating my content. I'm using html font crap when I should be using css.<br />
<br />
How is the content section usually designated is css? Do I use:<br />
<br />
<p> on the html page and then .p {} on the css page? Is that acceptable?<!--content-->Is the second text another heading, like <h2>? You could do:<br />
<style type="text/css"><br />
h1, h2{<br />
display:inline;<br />
}<br />
</style><br />
<h1><a href=http://www.webdeveloper.com/forum/archive/index.php/"C:\My Documents\link.html">SITENAME.COM</a></h1> <h2>This is the text I want to change.</h2><!--content-->
 
Back
Top