Clintonio Posted May 4, 2006 Share Posted May 4, 2006 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 More sharing options...
scott100 Posted May 4, 2006 Share Posted May 4, 2006 I know I need CSS, but I need to know if it possible within HTML and what to do.<{POST_SNAPBACK}> 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 More sharing options...
Clintonio Posted May 5, 2006 Author Share Posted May 5, 2006 Pretty much , but how would I be able to put that in my main CSS file and use it like class="2" in the <p> settings? Since I have a LOT of code and I wanna make it as minimal as possible Link to comment Share on other sites More sharing options...
scott100 Posted May 5, 2006 Share Posted May 5, 2006 Your talking about a External Stylesheet right?external.css .myclass{text-align: center;color: red;font-family: arial} on your page<p class="myclass">Hi there</p><h3 class="myclass">How are you</h3> Link to comment Share on other sites More sharing options...
Clintonio Posted May 5, 2006 Author Share Posted May 5, 2006 I was not talking about Headers and P I was just saying, I need to use an external stylesheet in the same way for my tables... Any idea how I can do that? Link to comment Share on other sites More sharing options...
scott100 Posted May 5, 2006 Share Posted May 5, 2006 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now