gpt4 book ai didi

css - 在 html 页面的左右两侧添加两条垂直线(矩形)

转载 作者:太空宇宙 更新时间:2023-11-04 12:30:44 30 4
gpt4 key购买 nike

我是 HTML 和 CSS 的新手,我想在 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>

最佳答案

您可以尝试在您的主体中创建一个 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/

关于css - 在 html 页面的左右两侧添加两条垂直线(矩形),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27679087/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com