tags:

views:

64

answers:

4

Hi all,

I need your help. Trying to work out how i can put a border around my page. Here is my html and css

<html>
<head>
<title>Royal Aura club</title>
<link rel="stylesheet" type="text/css" href="restyle.css" / >
</head>
<body>
<main id="main">
<div id="header">


<h1> Royal Aura club</h1>

<div id="nav">
         <div class="navitem"><a href="#">Home</a></div>
         <div class="navitem"><a href="#">Restaurant </a></div>
         <div class="navitem"><a href="#">Gallery</a></div>
         <div class="navitem"><a href="#">Guest list</a></div>
</div>       <div class="navitem"><a href="#">Job Vancancies</a></div>

<div id="content">  

            <div id="textblock">
            <h2>Why Royal Aura?</h2>

            <p>
            Royal Aura club and restaurant is located in Mayfair just a walk away from the Ritz.  
            We will guarantee you will have a ball of a time with our brilliant DJ playing the tunes while your sipping cocktails away and dancing the night away.
            <p>
            Aura is a glamorous and sophisticated club that has a beautiful decor to get the mood. If you fancy doing VIP in style drop us a e-mail, we will be glad to help. Not to mention our fabulous food dishes we serve are to die for.  
            Please make sure you e-mail us 24 hours before the day you want to come and party or dine.
            </p>

</div>







</body>
</html>

Css-


body     {
    front-family: verdana, arial, sans-serif;
    margin:0;
    padding: 0;
    background-color: #FFFDED;
    border:0px;


     }




#main    {
     background-color: #FFFFFF;
     width: 280px;
     margin: 50px auto;
     border: 0px solid;

     } 

#header  {

     border-bottom:none


     } 

#content {
     padding: 6em 1em;
         border: none;
     margin: 20px;
     }

#footer  {

        } 






h1  {

    font: bold 1.5em Tahoma, arial, sans-serif;
    color: #826BA9;
    font-style: italic;
    background-image: url(relogo.jpg);
    background-repeat: no-repeat;
    padding: 1em 1em 1em 120px;);
    background-repeat: no-repeat;
    padding: 1em 1em 1em 100px;
    }



.navitem {

        float: left;
        border-right: 3px solid #999999;
        border-top:1px solid #999999;
        text-align: left;

    }


#textblock   {
       background-color: #D4CAE2;   
       width: 300px;
       border: 4px solid #000000;
       padding: 10px 7px;
       float: left;
       font-size: 110%;
       text-align: left;
       height: 400px
        }


a:link {  
    text-decoration: none;
        color: #000000; 
        padding-left: 0.em;
    padding-right: 0.5em;
    float: right;

        }   




a:visited {
      text-decoration: none;
      color: #826BA9;
      padding-left: 0.5em;
      padding-right: 0.5em;
      }

a:hover   {
      text-decoration: none;
      color: #826BA9;
      background-color: #F4E8F0;
      display: block;
      } 

Thank you x

A: 

You will need to adjust the properties to match your desired result, but this should place a border around your page.

#main {
  border: 1px solid red;
}
Jason McCreary
What happens if `#main` is smaller than the document height?
Pekka
Hey, i tried that and it doesn't seem to work. I can see red on my textblock a litte and up the top of the image. Very stange. ANy more ideas?
By the user's HTML, it wraps the whole page content. So without seeing the other styles, my *assumption* is that would not be the case. However, you could use `body` instead of `#main` if that were the case.
Jason McCreary
It worked but half of the page has a border not all. The half bottom. What shall i do?
Did you see that your section `#main` element is not a `div`. I assume this is a typo. If you correct this and validate the rest of the page, things appear better.
Jason McCreary
Yes i noticed that. I have changed it. If put a </div> at the bottom of the page not no luck
You have several issues with your HTML and CSS. Without knowing the exact goal, it's tough to put you in the right direction. **Sam** has provided a good start.
Jason McCreary
I managed to get a border but the bottom bit is missing so i have a top,right, left border no bottom. If you guys know how to work out why let me know. You have been a great help all.
Oh my god!!!!!! i did it. Thanks
+3  A: 

I don't think <main> is a valid tag. Also, make sure to close your tags.

Replace this:

</body>
</html>

With this:

</div>
</div>
</body>
</html>

And replace this:

<main id="main">

With this:

<div id="main">

Lastly, replace this:

#main    {
     background-color: #FFFFFF;
     width: 280px;
     margin: 50px auto;
     border: 0px solid;

     }

Wtih this:

#main    {
     background-color: #FFFFFF;
     width: 280px;
     margin: 50px auto;
     border: 1px solid red; /* width, style, colour */
     } 

And change the border property accordingly.

If you want a border around the entire page, put that border property within body{} in your CSS.

Sam Nabi
+1  A: 
body {
border: 5px solid red;
}
rafaelcidade
A: 

I think, if width of your main container 280px and you want a put of your page a border (not to your all container div); your body class should be like this/

body {
  border: 5px solid red;
  width:100%;
  height:100%;
  display:block;
  overflow:hidden;
}
spielersun