Jump to content

Tables and backgrounds


Clintonio

Recommended Posts

I have created my site, and decided to WC3 it. I do not use much CSS. Mainly just scrollbar code which was a part of code my friend gave me to start me off on my first website.I am trying to create tables with backgrounds (Well <td> s.

<td colspan="4" height="129" background="forums/templates/ClanzDarkness/images/top2.jpg">

Now the W3C markup comes out with

Error Line 25 column 37: there is no attribute "BACKGROUND".          <td width="185" background="forums/templates/ClanzDarkness/images/cellYou have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead). This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information. How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute.
I know I need CSS, but I need to know if it possible within HTML and what to do.I know a little bit of CSS and I *thought* this might work.
td.top2 {background-image:url('forums/templates/ClanzDarkness/images/top2.jpg')}and using<td class="top2" colspan="4" height="129">instead of the old code.

This is quite hard and my venture into CSS has only just started, but I know HTML pretty well now, but not well enough, though in my 27 KB hand written pure HTML website the only remaining error is the background one...Please Help!-Clint

Link to comment
Share on other sites

I know I need CSS, but I need to know if it possible within HTML and what to do.

Is this what you meant?<td style="background-image:url('forums/templates/ClanzDarkness/images/top2.jpg');height:129px" colspan="4">
Link to comment
Share on other sites

That was just an example (mabye a bad one on my part!)this would apply to all tables

table{background-image:url('forums/templates/ClanzDarkness/images/top2.jpg');height:129pxtext-align: center;color: red;font-family: arial}

this would apply to <table class="mytable">

table.mytable{background-image:url('forums/templates/ClanzDarkness/images/top2.jpg');height:229pxtext-align: right;color: green;font-family: arial}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...