Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: (OT) CSS Codes

by cjcollier (Novice)
on Jun 07, 2009 at 19:18 UTC ( [id://769309]=note: print w/replies, xml ) Need Help??


in reply to (OT) CSS Codes

sure. put your css codes in a <style> element in the <html>...<head> section, for instance:
<html> <head> <style> span { color: black; } </style> <title>My title</title> </head> <body> <span>this should be black or something</span> </body> </html>

Replies are listed 'Best First'.
Re^2: (OT) CSS Codes
by ww (Archbishop) on Jun 08, 2009 at 01:13 UTC

    Redefining span this way makes about as much sense as redefining (just to get a little perl into this) print to mean foreach.

    <span> has a legitimate use -- to make a part of a markup element different from the rest. For example:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http:/ +/www.w3.org/TR/html4/loose.dtd"> <html> <head> <style type="text/css"> span { color: red; } blockquote{ margin-left: 6em; margin-right: 8em; font-style: italic } .red { color: red; background-color:transparent; } .b { font-weight: bold; color: green; background-color:#dddddd; } .black { color: black; background-color: #aaaaff; width: 8em; max-width:8em; text-align:center; } foobar { color: blue; background-color: transparent; font-size: 1.8em; font-style: italic; } .foobar { color: blue; background-color: red; font-size: 1.8em; font-style: italic; } </style> <title>My title</title> </head> <body> <p><span>this should be red... and it is, because browsers will genera +lly allow this abuse.</span> But a decent validator (CSS specific or +html/css) will tell you something like this:</p> <blockquote>The &quot;span&quot; tag has no attributes. Attributes are + normally used with the &quot;span&quot; element to provide functiona +lity.</blockquote> <p>Normal text. <span>red text</span> and back to normal.</p> <p><span class="b">And this bold, green and with a grey background.</s +pan></p> <p class="black">Black</p> <p class="span">Red? Not today! <foobar> ...because span is NOT a clas +s.</foobar> However, turning again to our validator:</p> <blockquote>The &quot;foobar&quot; is not a recognized element in this + selector. Is it misspelled?</blockquote> <p>Well, no, but while it works, there's no guarantee that it will tom +orrow ... or even today, in some browsers.</p> <p>dot_foobar (or even id foobar) would be a valid selector... used li +ke this: <span class="foobar">text rendered as spec'ed by dot_foobar< +/span></p> </body> </html>

    So if you're going to give advice on css, please do so with good advice; that is, with a decent respect for standards.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://769309]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-25 15:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found