为所有决议制作麻烦格式的网站

时间:2017-04-25 20:04:23

标签: html css background-color

你好,能够免费修理亲戚电脑的技术人员,

无论如何,我是一个相当新的编码器,我只是HTML / CSS的初学者。作为第一个项目,我正在为我爸爸做一个生日礼物的网站,因为他在大约15年内没有更新他的小企业网站,并通过他的代表得到他的大部分工作,但我想帮助他把它带入21世纪。

无论如何,我遵循了几个关于如何创建一个简单网站的YT教程,但我的网站ATM大约是800px,看起来像他当前的网站,因为无论你的屏幕大小是多少,文本只会填写1 / 3-1 / 2的屏幕。

我首先想要的主要是背景颜色,尤其是标题,以消除屏幕,第二,在更改浏览器尺寸时缩放文本/图片。

我尝试在其他线程上寻找一些答案,但我很难理解,因为其他人的分隔符和变量都有自己的名字。

这是我的HTML和CSS的一部分。当然,我删除了大部分代码,如大多数文本,文本格式等,以及名称和地点。

HTML:

setTimeout(function () {
    $('#txtShipAddress>option:eq(0)').prop('selected', true);
}, 3000);

这是CSS

<DOCTYPE html>
<html>
<head>
<title>Website</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body>
<div id="container">
<div id="header">
<h1>Dad's Company</h1>
</div>
<div id="content">
<div id="main">
<h2>Person Name</h2>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
</div>
</div>
<div id= "footer">
Copyright &copy; 2017 Ye Co.
</div>
</div>
</body>
</html>
----------

谢谢! 我希望你们能通过杂乱的编码找到答案。如果你们能给我一些代码示例而不是给我一个解决方案,它也会有所帮助。谢谢!

2 个答案:

答案 0 :(得分:-1)

删除id =“main”,您可以正确对齐段落。

答案 1 :(得分:-1)

<DOCTYPE html>
<html>
<head>
<title>Website</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
<style>
body {
    background-color: #FFFFFF;
    overflow-x: hidden; 
    width: 100%;
    height: 100%;
}

h1 {
    margin-left: 10px;
    padding: 30px;
    text-align: center;
}

h2 {
    color: #4F4F4F;
    text-align: center;
}

#header {
    background-color: #992626;
}

#container {
    background-color: #DDDDDD;
    width: 800px;
    margin-left: auto;
    margin-right: auto;
}

 #site { 
    overflow-x: hidden; 
 }

#content {
    padding: 10px;
    text-align: center;
    float: right;
}

#main {
    width: 600px;
    float: center;
}

#footer {
    clear: both;
    font-size: 15;
    text-align: center;
    padding: 5px;
    background-color: #992626;
    font-family: serif;
}
</style>
</head>
<body>
<div id="container">
<div id="header">
<h1>Dad's Company</h1>
</div>
<div id="content">
<div >
<h2>Person Name</h2>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
</div>
</div>
<div id= "footer">
Copyright &copy; 2017 Ye Co.
</div>
</div>


</body>
</html>