Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 制作网站副本_Html_Css_Copy_Padding - Fatal编程技术网

Html 制作网站副本

Html 制作网站副本,html,css,copy,padding,Html,Css,Copy,Padding,我试图用html和css复制这个网站,以供练习 但是我在menuArea分区中使用填充时发现了一些问题 HTML <header> <div class="head1"> <div class="logoArea"> <img id="logo" src="https://www.raidhqgame.com/images/RHQ_Logo_680x200.png" alt="RAID_HQ LOGO"

我试图用html和css复制这个网站,以供练习 但是我在menuArea分区中使用填充时发现了一些问题

HTML

<header> 
    <div class="head1"> 
        <div class="logoArea">
            <img id="logo" src="https://www.raidhqgame.com/images/RHQ_Logo_680x200.png" alt="RAID_HQ LOGO"/>
        </div>
    <div class="menuArea">
        <a href="#">HOME</a>
        <a href="#">FEATURES</a>
        <a href="#">VIDEO & SCREENS</a>
        <a href="#">REVIEWS</a>
        <a href="#">DOWNLOAD</a>
        <a href="#">HELP</a>
        <a href="#">EPS</a>
    </div>
</div>
<div class="background_img"> 
    <img src="https://www.raidhqgame.com/images/RAID_Web_BG_01_1500x800.jpg" alt="" />
</div>

问题:当我向menuArea div添加填充时,menuArea会跳下。此外,“head1”类和“background_img”类之间也存在差距

如何解决这两个问题?

我认为您可以通过在head1 div而不是menuArea中添加填充来获得所需的效果

以下是您的更新代码:

CSS

body{
    margin:0;
    padding:0;
}
.head1{
    height:60px;
    background:black;
}
.logoArea{
    float:left;
    width:40%
}
#logo{
    height:40px;
    padding:10px 0px 10px 110px;
}
.menuArea{
    display:block;
    float:right;
    width:60%;
}
a:link{
    text-decoration:none;
    color: green;
    font-family: "Poppins",sans-serif;
    font-weight:bold;
    font-size:12px;
    letter-spacing: 1px;
}
.head1{
    height:60px;
    background:black;
    padding: 20px; // You should change this value to whatever you want
}
.head1{
    height: 80px; // Increased height to make space for the navigation bar
    background:black;
}

.menuArea{
    display:block;
    float:right;
    width:60%;
    padding: 20px 0; // Added padding at the top and bottom of the navigation bar, change these values according to your needs.
}
“而且“head1”类和“background\u img”类之间也存在差距。我无法重现这种差距。

更新


'我想为菜单部分添加填充。不是整个脑袋1。

我更新了代码:

CSS

body{
    margin:0;
    padding:0;
}
.head1{
    height:60px;
    background:black;
}
.logoArea{
    float:left;
    width:40%
}
#logo{
    height:40px;
    padding:10px 0px 10px 110px;
}
.menuArea{
    display:block;
    float:right;
    width:60%;
}
a:link{
    text-decoration:none;
    color: green;
    font-family: "Poppins",sans-serif;
    font-weight:bold;
    font-size:12px;
    letter-spacing: 1px;
}
.head1{
    height:60px;
    background:black;
    padding: 20px; // You should change this value to whatever you want
}
.head1{
    height: 80px; // Increased height to make space for the navigation bar
    background:black;
}

.menuArea{
    display:block;
    float:right;
    width:60%;
    padding: 20px 0; // Added padding at the top and bottom of the navigation bar, change these values according to your needs.
}

我认为通过在head1 div而不是menuArea中添加填充,您可能会获得所需的效果

以下是您的更新代码:

CSS

body{
    margin:0;
    padding:0;
}
.head1{
    height:60px;
    background:black;
}
.logoArea{
    float:left;
    width:40%
}
#logo{
    height:40px;
    padding:10px 0px 10px 110px;
}
.menuArea{
    display:block;
    float:right;
    width:60%;
}
a:link{
    text-decoration:none;
    color: green;
    font-family: "Poppins",sans-serif;
    font-weight:bold;
    font-size:12px;
    letter-spacing: 1px;
}
.head1{
    height:60px;
    background:black;
    padding: 20px; // You should change this value to whatever you want
}
.head1{
    height: 80px; // Increased height to make space for the navigation bar
    background:black;
}

.menuArea{
    display:block;
    float:right;
    width:60%;
    padding: 20px 0; // Added padding at the top and bottom of the navigation bar, change these values according to your needs.
}
“而且“head1”类和“background\u img”类之间也存在差距。我无法重现这种差距。

更新


'我想为菜单部分添加填充。不是整个脑袋1。

我更新了代码:

CSS

body{
    margin:0;
    padding:0;
}
.head1{
    height:60px;
    background:black;
}
.logoArea{
    float:left;
    width:40%
}
#logo{
    height:40px;
    padding:10px 0px 10px 110px;
}
.menuArea{
    display:block;
    float:right;
    width:60%;
}
a:link{
    text-decoration:none;
    color: green;
    font-family: "Poppins",sans-serif;
    font-weight:bold;
    font-size:12px;
    letter-spacing: 1px;
}
.head1{
    height:60px;
    background:black;
    padding: 20px; // You should change this value to whatever you want
}
.head1{
    height: 80px; // Increased height to make space for the navigation bar
    background:black;
}

.menuArea{
    display:block;
    float:right;
    width:60%;
    padding: 20px 0; // Added padding at the top and bottom of the navigation bar, change these values according to your needs.
}
  • 您只需从类menuArea中删除width=60%,就可以添加任何类型的填充或
  • 仅使用顶部和底部填充,不使用左右填充,因为您通过设置40%60%覆盖了整个100%宽度,并且当您向其添加左右填充时,会增加导致此问题的宽度
  • 第二期增加高度:logoArea类100%

  • 您只需从类menuArea中删除width=60%,就可以添加任何类型的填充或
  • 仅使用顶部和底部填充,不使用左右填充,因为您通过设置40%60%覆盖了整个100%宽度,并且当您向其添加左右填充时,会增加导致此问题的宽度

  • 第二期增加高度:logoArea类100%。

    我想在菜单部分添加填充。不是整个头部1你能发布一个你想要实现的屏幕截图吗?@ImrulKayes我更新了我答案中的代码。你能看看这是不是你想要实现的吗?我想在菜单部分添加填充。不是整个头部1你能发布一个你想要实现的屏幕截图吗?@ImrulKayes我在回答中更新了代码。你能看看这是不是你想要的吗?