2014-12-28 66 views
0

我是HTML,CSS的新手,我想在html页面的两侧(左侧和右侧)添加两条垂直线。 的帮助下位将是非常赞赏...非常感谢确实 编辑:该代码现已添加在html页面的右侧和左侧添加两条垂直线(矩形)

  <!doctype html> 
      <html lang="en"> 

      <head> 
      <style> 
      #button1{ 
      width: 300px; 
      height: 40px; 

      } 

      #button2{ 
      width: 300px; 
      height: 40px; 
      } 

      #link1{ 
      font-size: 33px;} 

      #pic1 { 
       position:fixed; 
       left:30%; 
       top:30%; 
       margin-left:-382px /*half the width*/ 
       margin-top:-370px /*half the height*/ 
      } 



      </style> 

      <meta charset="utf-8"> 
      <meta name="Homepage" content="Starting page for the survey website "> 

      <title> Survey HomePage</title> 
      </head> 

      <body> 

      <img src="kingstonunilogo.jpg" alt="uni logo" style="width:180px;height:160px"> 
      <button type="button home-button" id="button1" >Home</button> 
      <button type="button contact-button" id="button2">Contact Us</button> 
      <a href="http://www.w3schools.com/html/" id="link1">LogIn</a> 
      <img src="homepagepic.jpg" alt="homepagepic" id="pic1" style="width:400px;height:350px"> 



      </body> 
      </html> 
+0

当然,我们想帮助。但是,您希望我们帮助您的代码在哪里? – arkascha

+0

它现在已经被添加了......非常感谢 – Hollywood

回答

1

你可以尝试建立在你的身体一个div容器,并设定边界,沿东西这些行:

<body style="width:100%"> 
//you can set the div-width to 100% too, I'm setting it to 95% so you can see it.// 
    <div style="width:95%;border-left:1px solid #000;border-right:1px solid #000;"> 
     Page contents go here 
    </div> 
</body> 

前瞻:http://jsfiddle.net/pbj4xxh0/

+0

非常感谢......你如何让他们一路走下去? – Hollywood

+0

@好莱坞只需添加更多文字,或将div和身高设置为100%(style =“height:100%”) – thepieterdc