Jump to content


XHTML and css website


6 replies to this topic

#1 Wazzup

    Young Padawan

  • Members
  • Pip
  • 217 posts

Posted 12 February 2006 - 05:10 PM

Hey,

just making a website for school, here is the early version: http://members.chell.../portfolio_site

I fexed all common errors that dont validate at http://validator.w3.org/ but 1 still remains. In my CSS i i said all links including images have a orange border that change to white on hover. Offcourse i didn't want this on my buttons, so i gave them the attribute

border = "0"

But now that piece doesnt validate, check it out yourself. Is that attribute forbidden in XHTML or did i make a mistake? how can i solve this?

thanks, Wazzup

#2 ericrcan

    Young Padawan

  • Members
  • Pip
  • 103 posts

Posted 12 February 2006 - 05:46 PM

you can do this is css:

.roll-image a:hover img {
	border:2px solid #ffffff;
}

.roll-image a img {
	border: 2px solid #your orange;
}

then in your html do it this way:

<span class="roll-image"><a href="yourlink.html"><img src="yourimg.gif" alt="your alt here" /></a></span>

what that is, is just the link and image like normal, but added the span class..so if you dont put a span there, it wouldnt show it..

that is what i would do...

Edited by zYpher, 12 February 2006 - 05:52 PM.


#3 Wazzup

    Young Padawan

  • Members
  • Pip
  • 217 posts

Posted 12 February 2006 - 05:56 PM

ok but border is forbidden, or could i have made a typo that makes the error?

#4 ericrcan

    Young Padawan

  • Members
  • Pip
  • 103 posts

Posted 12 February 2006 - 06:01 PM

"Validation" said:

You 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).

.i would just take out the border..and use purely css and span

Edited by zYpher, 12 February 2006 - 06:06 PM.


#5 Wazzup

    Young Padawan

  • Members
  • Pip
  • 217 posts

Posted 12 February 2006 - 06:12 PM

View PostzYpher, on Feb 12 2006, 11:46 PM, said:

you can do this is css:

.roll-image a:hover img {
	border:2px solid #ffffff;
}

.roll-image a img {
	border: 2px solid #your orange;
}

then in your html do it this way:

<span class="roll-image"><a href="yourlink.html"><img src="yourimg.gif" alt="your alt here" /></a></span>

what that is, is just the link and image like normal, but added the span class..so if you dont put a span there, it wouldnt show it..

that is what i would do...

yeah but if i dont put the span at my buttons there still shows up the standard blue line

edit:

nm i got it. for the images standard blue stroke i tried

a {
border: none
}

didnt work so then i understood your img and used

a img {
border: none
}

that worked. Didnt even know it recognizes an img url. fully valid xhtml now, im happy!

thanks a lot!

Edited by Wazzup, 12 February 2006 - 06:31 PM.


#6 ericrcan

    Young Padawan

  • Members
  • Pip
  • 103 posts

Posted 12 February 2006 - 06:46 PM

nice job! will wait for the full site to be done :P

#7 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 12 February 2006 - 08:36 PM

you dont need to use a img{}, just img{}





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users