How to set border of frameset to 0 in CSS?


I'm trying to set the border width of a framset to 0 in CSS, but can't work it out.

Tried {border-width: 0px}

but doesn't work

Can anyone help?

Who is Participating?
Hi Adam

You can't make a valid frameset without borders showing in some way.
You can hide the gray borders by using frameborder=0 on your frames but it does not
remove the space taken up by the borders.

The only thing that does excatly what you want is border=0 and that is not a valid
frameset attribute in any Document Type Definition...

In general you should not use frames. Frames give rise to a wide variety of problems
both for general usability and specifically for accessibility by users with disabilities.
Try using alternative HTML technologies like includes.

If for some reason you have no other options than using frames remember to include
the noframes (only in HTML 4.01 Frameset)

<frameset cols="175,*">
       Your browser does not handle frames!

Best, Jakob E

Hi AdamJSawyer,

Do you have to set the border in CSS? Using HTML you can just set the frameborder attribute to 0:

<frameset cols="120,*" frameborder="0">

I believe that most browers do not support the styling of frames.

Hope this helps!

AdamJSawyerAuthor Commented:
Yes I have to use CSS because FRAMEBORDER and BORDER attributes are not supported in the HTML validation.

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

are you using the correct *frameset* doctype?
AdamJSawyerAuthor Commented:
Yes I am, and I am still getting the error. My code for the DOCTYPE was slightly different to that listed at the w3 site, and I have changed it to match, and still get the following error:

 Below are the results of attempting to parse this document with an SGML parser.

   1. Error Line 10 column 31: there is no attribute "BORDER".

      <frameset cols="175,*"  border="0">

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

      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.

AdamJSawyerAuthor Commented:
Here is the entire file:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
  <title>Brain Lumley Books - Online!</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">      

<frameset cols="175,*"  border="0">
  <frameset rows="139,*" border="0">

    <!-- Top Left Logo -->
    <frame src="TopLeftLogo.html" scrolling="no" marginwidth="0" noresize name="TLLogo">

    <!-- Reviews Panel -->
    <frame src="SidePanel.html" marginheight="10" marginwidth="0" noresize name="SidePanelFrame">


  <frameset rows="75,64,*,70" border="0">

    <!-- Brian Lumley Page Heading -->
    <frame src="LumleyLogo.html" scrolling="no" marginheight="0" marginwidth="10" noresize name="LumLogo">

    <!-- Image List for Book Reviews -->
    <frame src="LumleyImList.html" scrolling="no" marginheight="0" marginwidth="10" noresize name="LumList">

    <!-- Main viewing frame -->
    <frame src="LumleyIntro.html" marginheight="10" marginwidth="20" noresize name="MainFrame">
    <!-- Contact frame -->
    <frame src="LumleyFooter.html" scrolling="no" marginheight="0" noresize name="LumContact">

AdamJSawyerAuthor Commented:

At least I know where I stand now.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.