Click to See Complete Forum and Search --> : Changing text in CSS
mike444
02-28-2003, 04:14 PM
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?
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.
H1 { white-space : nowrap; color: white; font-size: 50px; font-family: impact }
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 }
p {white-space : nowrap; color: yellow; font-size: 20px; font-style: italic; font-weight: bold; border: 3px double orange }
i { color: white; font-size: 15px }
t { color: yellow; font-size: 15px }
-->
</STYLE></HEAD>
<BODY BGCOLOR="#000000">
<H1><a href="C:\My Documents\link.html">SITENAME.COM</a>&nbsP;</t>This is the text I want to change.</t></H1>
Zach Elfers
02-28-2003, 10:57 PM
Use a <span> tag.
<style type="text/css">
<!--
h1 {properties}
#t {properties}
-->
</style>
...
<h1>Text<span id="t">Text</span>Text</h1>
Stefan
03-01-2003, 03:24 PM
Originally posted by mike444
[B]
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.
If it is NOT a part of the heading, it should NOT be inside the <hx>.
For your desired effect try eg this
<div>
<h1>blabla</h1>
<span>Text on the same line</span>
</div>
h1 {display:inline;}
mike444
03-01-2003, 07:56 PM
Originally posted by Zach Elfers
Use a <span> tag.
<style type="text/css">
<!--
h1 {properties}
#t {properties}
-->
</style>
...
<h1>Text<span id="t">Text</span>Text</h1>
this did the trick! Thanks!
Stefan, will try. Thanks!
nkaisare
03-02-2003, 03:21 PM
Originally posted by mike444
Stefan, will try. Thanks!
For the benefit of those who didn't understand the difference between Zach's and Stefan's suggestions:
<h1>SITENAME.COM <span class="t">This is the text I want to change</span></h1>
<div><h1>SITENAME.COM</h1> <span class="t">This is the text I want to change</span></div>
In the first example, "SITENAME.COM This is the text I want to change" is the page heading.
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.
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.
mike444
09-20-2005, 08:47 AM
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.
How is the content section usually designated is css? Do I use:
<p> on the html page and then .p {} on the css page? Is that acceptable?
IncaWarrior
09-20-2005, 09:23 AM
Is the second text another heading, like <h2>? You could do:
<style type="text/css">
h1, h2{
display:inline;
}
</style>
<h1><a href="C:\My Documents\link.html">SITENAME.COM</a></h1> <h2>This is the text I want to change.</h2>