It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming HTML Forum

Some missing Font Elements in CSS giving me probelms

Some missing Font Elements in CSS giving me probelms

Postby hemanthjava on Fri Oct 06, 2006 2:16 am

I downloaded a free CSS template which I am using for my Website namely http://www.java-swing-tutorial.com

Now I ran the HTML Validator for my site using the Validator located at

http://validator.w3.org/

I am getting huge number of errors with respeck to font and font attributes that are not present in the css which is giving me hell lot of errors.

How do I include them in my css. Please let me know what changes I need to make in my css file. I am hereby sending you the css link as below.

http://www.java-swing-tutorial.com/default.zip

Regards,
Hemanth
hemanthjava
 
Posts: 0
Joined: Fri Oct 06, 2006 2:01 am

Postby johneva on Fri Oct 06, 2006 11:36 am

Right I have just took a quick look at your site and ran the validators for both CSS and HTML/XHTML and the CSS one wont give any results yet as the HTML/XHTML file is not valid yet.

The main problem which I think is what you were trying to explain is the use of the font tag which does not exsit anymore in valid XHTML.


You can just set properties for existing tags like the H1 tag. (Shown below) This way all you do then is use the H1 tag as normal and it will be diplayed as the CSS properties have been set.

Code: Select all
h1 {
     color: #e0e0e0;
     background-color: #000;
}




But sometimes you want to have diffrent properties for the same tag (as in two diffrent sections of text both inside the P tag) to get around this you will need to make a class and set the properties in css either at the head of the doc or even better in a seperate CSS file and the refer to that class in your HTML/XHTML

The CSS would look like so.

Code: Select all

.redtext {
     color: #f00;
     background-color: #000;
}

.bluetext {
     color: #0f0;
     background-color: #000;
}


Then your HTML/XHTML woul be like so.

Code: Select all
<p class="redtext">Text here will be red</p>
<p class="bluetext">Text here will be blue</p>


Here are a couple of sites that have loads of CSS tutorials.

http://www.htmldog.com
http://www.w3schools.com
Image
Only God Can Judge Me.
User avatar
johneva
500+ Club
 
Posts: 565
Joined: Sat Oct 29, 2005 1:16 pm
Location: Stafford, England


Who is online

Users browsing this forum: No registered users and 9 guests