|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
CSS: Defining own styles
I've read up, and have always used a bit of CSS. I'm redoing my site, and noticed something different between Mozilla and IE.
Personally, I'd ditch IE, but 98% of my viewers use it, so I can't. Basically, in IE, the following works: Code:
P
{
color: black;
font-size: 10pt;
font-family:tahoma;
}
myown
{
color: blue;
font-size: 10pt;
font-family: Tahoma;
}
<myown>This is my text</myown>
When I run it in IE though, it basically ignores the self-defined tag, and requires me to use a pre-defined keyword. I don't want to use "P", b/c it carries the html<P> tag characteristics... a new line in this case. Thanks. |
|
#2
|
|||
|
|||
|
you need to specify whether it is a # or . ...
ie... use this if you are going to use the class more than once on a page Code:
.myown
{
color: blue;
font-size: 10pt;
font-family: Tahoma;
}
for this case you would specify in the HTML Code:
<div class="myown">This is my text</div> if you use a # instead of a . then you should only use this element ONCE per page. the HTML would look like this. Code:
<div id="myown">This is my text</div> |
|
#3
|
|||
|
|||
|
You're a rockstar. Thanks. I need to read up on DIV and CLASS I suppose.
Actually, I tried it like this (just experimenting, not knowing what they would do. They solved one problem, but not another. What I'm trying to do is print out a page counter (like in a forum). I've got a Perl script that calculates the number of pages, and then prints them out with links. The problem was, it was stupid to have a link to the page you were on. When I used "P" (assuming you were on page 4 of 7) it looked something like 1, 2, 3, 4, 5, 6, 7, Using .myown as you stated above worked, but only when I closed the DIV after ALL of the pages were displayed. I assume breaking a DIV is going to start everything after that on a new line? Anyways, thanks! |
|
#4
|
||||
|
||||
|
yea why not just make the page numbers in their own div/span?
good lucky and rock on!! ![]()
__________________
"I hate quotations." -ralph waldo emerson- |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > CSS: Defining own styles |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|