|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
CSS Type setting question
I am having no luck using this rule to set text with-in the body tags correctly.
body{font-family: sans-serif; font-size: 11px; color: #CC0000} This line will set the color and family of the text but it doesnt effect the typeface's size or any other parameters either. I have tried both pt's and px's but no luck. When I use the <span> configuration for text all is fine. But when I use a rule as above something doesn't work. Any ideas? Thanks |
|
#2
|
||||
|
||||
|
If above is the only line you are using, it is very limited.
Show an example to make suggestion easier. Good luck ![]()
__________________
© AZ AZbb :: AZ Bulletin Board - Secure BBS script, Front page CMS, Chat, No database Simple Guide to Apache and PHP installation on Windows |
|
#3
|
|||
|
|||
|
Here is the entire externally linked sheet. I have tried getting the body rule to work with just the one afore mentioned line as well as in the context of the full sheet. Same result either way only the the text color renders.
Here the full style sheet. body{font-family: sans-serif; font-size: 11px; color: #CC0000} .textblack{font-family: sans-serif; font-size: 11px; color: #000000} .textwhite {font-family: sans-serif; font-size: 11px; color: #ffffff} .textred{font-family: sans-serif; font-size: 11px; color: #CC0000} .textredbold {font-family: sans-serif; font-size: 11px; font-weight: bold; color: #CC0000} .textwhitebold {font-family: sans-serif; font-size: 11px; font-weight: bold; color: #ffffff} .textdisplayhuge {font-family: sans-serif; font-size: 38px; font-weight: bold; color: #ffffff} .warningtext {font-family: sans-serif; font-size: 14px; font-weight: bold; color: #CC0000} .inputfield {font-family: sans-serif; font-size: 11px; font-weight: normal; background-color: #EEF3DD; border: 1px solid #666666} .submitbutton {font-family: sans-serif; font-size: 10px; background-color:#BAE8F5; color: #000000} a:link { font-family: sans-serif; font-weight: bold; font-size: 11px; color:#000000 text-decoration: none;} a:visited {font-family: sans-serif; font-weight: bold; font-size: 11px; color:#000000 text-decoration: none;} a:hover {font-family: sans-serif; font-weight: bold; font-size: 11px; color:#CC0000 text-decoration: none;} a.white:link { font-family: sans-serif; font-size: 11px; color:#ffffff} a.white:visited {font-family: sans-serif; font-size: 11px; color:#ffffff } a.white:hover {font-family: sans-serif; font-size: 11px; color:#CC0000} |
|
#4
|
||||
|
||||
|
In order to make sure there are no 'inheritance' problems you should group them together
i.e.: PHP Code:
Many of the listed CSS inherit their values form their parents i.e.: .textblack from div.textblack or span.textblack or td.textblack It would be more cross browser, cross platform compatible. Good luck ![]() |
|
#5
|
|||
|
|||
|
Thanks for the input but it still doesn't work right. When I used the code you wrote I still could not change the point size and also instead of being set in sans-serif it was the default serif.
Strange. I have a bit of an understanding of inheritnce but maybe you could expand on how it directly effects this case? Also with the grouped rule I assume that should style all of the tags in the list? I am pretty new to CSS. Thanks for your help you are awesome! |
|
#6
|
||||
|
||||
|
Can you post the actual html [a sample]?
I would want to see what above classes are. Good luck ![]() |
|
#7
|
||||
|
||||
|
Quote:
Actually, that can lead to problems. Code:
body, div, span, dl, ul, td
{font-family: sans-serif; }
is better done as
body {
font: sans-serif 11px;
color: #333;
background-color: #fff;
}
To find the problem(s) with your code, use this method. cheers, gary
__________________
There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing. My html and css workshop, demos and tutorials. Ask a better question, get a better answer. |
|
#8
|
|||
|
|||
|
Here is one php file that is linked to the style sheet. The sheet styles the entire app that this file belongs to. The only part of this file that the body rule would apply to would be the line that is commented. The other text on the page are different <span> classes. I know this is overall probably a pretty clunky way to us css. But I guess thats why I'm on the forum.
Thanks! <htmL> <head> <link rel=stylesheet href="../../master.css" type="text/css"> </head> <body bgcolor='#5A5E4C' leftmargin ='2' topmargin='0' marginwidth='0' marginheight='0'> <?php ## Query database and get data from email_list_outgoing_info. ## If error from proccessor script was logged then this page is loaded with ## new vars that were entered from user, instead of DB data. if($no_DB_reload != 1) { ####### QUERY ####### $query="SELECT * FROM email_list_outgoing_info WHERE id ='$list_name'"; $result = mysql_query ($query); $row = mysql_fetch_array ($result); extract($row); } ## Begin form. print" <form enctype='multipart/form-data' action='outgoing_info_processor.php' method='POST'> <table width='100%' bgcolor='#000000' border='0' cellspacing='0' cellpadding='3'> <tr><td width='300'> </td> <td width='450'> ########### The line of text below is an exapmle of where ###### #### the body rule would style my text. Subject *required <br> <input type='text' name='subject' value='$subject' size = '48' maxlength = '100' class='inputfield'> <br> <br> <span class='textwhite'>Message *required</span> <br> <textarea name='body' rows='16' cols='45' class='inputfield'> $body </textarea> </td> <td> <span class='textwhite'>Signature</span> <br> <textarea name='signature' rows='5' cols='45' class='inputfield'> $signature </textarea> <br><br><br> <iframe src='outgoing_info_attach_info.php' width='60%' height='75' frameborder='0' scrolling='no'></iframe> <br> <span class='textwhite'>New/Replace attachment:</span> <br> <input name='attachment' type='file' size = '18' class='inputfield'> <br> <br> <input type='submit' name='submit' value='Submit changes' class='submitbutton'> <input type='submit' name='submit' value='Reset' class='submitbutton'> <input type='submit' name='submit' value='Cancel' class='submitbutton'> </td> </tr> </table> </form>"; ?> </body> </htmL> |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > CSS Type setting question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|