gpt4 book ai didi

html - 如何自动设置html布局的大小?

转载 作者:行者123 更新时间:2023-11-28 05:46:14 25 4
gpt4 key购买 nike

大家好,我刚开始接触这种格式,了解如何自动设置 html 的设计。

在我的 PC 上它可以正常工作,即使设计很好,没有破坏格式或布局,但是当我在另一台 PC 上工作时,格式被破坏了。

即使在我的图片背景和格式损坏之前,它的背景也是白色的。我的电脑显示器是 18 英寸,另一台笔记本电脑是 23 英寸。

我尝试自己找出问题所在,但我不知道最佳解决方案。

我应该输入什么代码才能正常工作?

<!DOCTYPE html>
<html lang="en">
<head>
<title>IT Course SUPPLIES</title>
<meta charset="utf-8">
<link rel="shortcut icon" href="iicon.jpg">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="bootstrap2.js">
<script src="bootstrap1.js"></script>
<script src="bootstrap.js"></script>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

</head>
<body>

<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" ><font color="#FF0066">IT COURSE SUPPLIES</font></a>
</div>
<div>
<ul class="nav navbar-nav">
<li class="active"><a href="index.html">Home</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">First Year <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="1.html"> Analytic Geometry: with more Applications and Special Topics</a></li>
<li><a href="2.html">Differential Equations: A Simplified Approach</a></li>
<li><a href="3.html">Basic Calculus</a></li>
<li><a href="a.html">Simplified Approach to Integral Calculus</a></li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">2nd Year <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="4.html">Crimping Tool</a></li>
<li><a href="5.html">RJ45 + RJ11 Cable Tester</a></li>
<li><a href="6.html">RJ45 Toolless Jacks</a></li>

<li><a href="8.html">Discrete Mathematics 1</a></li>
<li><a href="9.html">General Statistics for College Students: Text/Workbook</a></li>
<li><a href="10.html">CISCO CERTIFIED CCNA Routing and Switching Laboratory Manual</a></li>
<li><a href="11.html">CAT5E Network Cable</a></li>
<li><a href="12.html">RJ45 heads</a></li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">3rd Year <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="13.html">Rizal Prose</a></li>
<li><a href="14.html">Rizal's Poems</a></li>


</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">

</ul>
</div>
</div>
</nav>
<br />
<br />
<br />
<style>
body {
background-image: url('12.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
background-position: 200px 50px;
}
</style>
<style>
div.absolute {
position: absolute;
top: 100px;
right: 400px;
width:500px;
height: 100px;
}
</style>
<div class="absolute">
<h1>about IT Online Course store</h1>

<p>
IT Online Course online store delivers digital products to your door.<br>
You can now get the latest high-tech products delivered straight to your door with IT Online Course.<br>
You can also choose from a new range of products and services ideally suited to meet <br>
the needs of the modern traveler.</p>
</div>
</body>
</html>

您可以找到代码 Here谢谢!

最佳答案

这是因为多个屏幕分辨率的屏幕分辨率,你必须使用媒体查询,你可以在其中编写你的网站布局以适应移动设备、标签、桌面、大屏幕...

1.媒体查询

@media screen and (max-width: 699px) and (min-width: 520px) {
ul li a {
padding-left: 30px;
background: url(email-icon.png) left center no-repeat;
}
}

http://www.w3schools.com/css/css3_mediaqueries_ex.asp

2.引导这里引导框架有助于预定义的类,这也给你

<div class="container">
<div class="row">
<div class="col-sm-4">
<h3>Column 1</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
</div>
</div>
</div>

http://www.w3schools.com/bootstrap/default.asp

关于html - 如何自动设置html布局的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37587346/

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