CSS Li and Underline

Status
Not open for further replies.
Works fine for me; using this:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Black Text Red Underline</title>
<style type="text/css">
div.blackred {text-align:center}
span.c2 {text-decoration: underline; color: red;}
span.c1 {color: black;}
</style>
</head>
<body>
<div class="blackred"><span class="c2"><span
class="c1">Black
text, red underline</span></span>
</div>

</body>
</html>
 
CrazeD,
This is what i have in my CSS
span.c2 {text-decoration: underline; color: red;}
span.c1 {color: cfcfff;}
div.blackred {text-align:center}

and here the HTML code for the red underline is published
Solution For Iron Deficiency Due To Iron Supplement Causing Digestive Problems For Iron Deficiency Due To Iron Supplement Causing Digestive Problems/


I tried removing the line <?php echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>" ?> that I have just before the Doctype, but it didn't fix the problem. (The line is for stopping IE6 from having the pages shifted to the right off the browser.)

I can't figure it out, maybe it's a wordpress thing?

Rex
 
CrazeD,
This is what i have in my CSS
span.c2 {text-decoration: underline; color: red;}
span.c1 {color: cfcfff;}
div.blackred {text-align:center}

and here the HTML code for the red underline is published
Solution For Iron Deficiency Due To Iron Supplement Causing Digestive Problems For Iron Deficiency Due To Iron Supplement Causing Digestive Problems/


I tried removing the line <?php echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>" ?> that I have just before the Doctype, but it didn't fix the problem. (The line is for stopping IE6 from having the pages shifted to the right off the browser.)

I can't figure it out, maybe it's a wordpress thing?

Rex

You forgot the # symbol before the text color.

Code:
span.c2 {text-decoration: underline; color: red;}
span.c1 {color:#cfcfff;}
div.blackred {text-align:center}
 
Craze,
I have been meaning to check my work with a validator before asking, so I did, after the fact, and it passed, and now I realize a CSS validator check is also necessary when everything looks right. Of course, even the error "Value Error : color cfcfff is not a color value : cfcfff " may not provide the necessary detail.

Thanks,

Rex
 
CrazeD,
I want to put the code in a <ul> and I found you can change <div> to <li> and it will work. One problem though, but I'll skip the explanation and ask this question
If I have
<ul class="linklist"> that means all the <li>s in the <ul> follow the "linklist" css class. What if I have an <li> in the <ul> that I don't want to follow "linklist" class? How do I code that <li>?

----

The code:
<li class="uncoleft">
<span class="c2">
<span class="c1">
<strong>Solutions</strong></span></span></li>
<li class="uncolright">
<span class="c2">
<span class="c1"><strong>and Cures</strong></span></span></li>


Is the title for the links of the link list.


Thanks,

Rex
 
It will inherit some things, but other things might need to be defined to the <li> specifically.

If <li> inherits something you don't want, you can just change the CSS for <li>

For example:

Code:
ul { color: #fff; }
li { color: #000; }
 
Status
Not open for further replies.
Back
Top Bottom