最近尝试了一下一个网站主页设计,主要部分都完成了
外表还算美观,简单容易上手。
废话不多说,先上效果图:
首先初期布局大致是这样:
一个头部加一个尾部加主体内容(颜色为了方便大家辨认设置的)
在此基础上进行修正和样式设计
中间要多加注意的部分在导航栏和搜索框的地方:
上代码(有些学习过程的个人理解的注释删除了,为了不影响大家观看代码,有需要注释版的可以留言):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Home</title>
<style type="text/css">
body{
background: linear-gradient(to bottom right,#101010,#808080);
}
#Container{
width: 1305px;
max-height: 900px;
margin: 0 auto;
background: #1c1c1c;
overflow: auto;
}
#search {
width: 1305px;
height: 38px;
margin: 0 auto;
color: #000101;
}
.bar{
height: 42px;
float: left;
}
input, button {
border: none;
outline: none;
}
input {
width: 1247px;
height: 42px;
padding-lef