gpt4 book ai didi

HTML 在同一行显示两个 div

转载 作者:行者123 更新时间:2023-11-28 01:26:23 25 4
gpt4 key购买 nike

只是想知道是否有人可以帮助我将此代码笔上的第一半部分和第二半部分显示在同一行上?我试过 display:inline; 但这并没有解决问题。

http://codepen.io/EuanR/pen/BNEBvE

HTML:

<HTML>
<HEAD>
<title>Homepage</title>
</HEAD>

<HEADER>
<H1 id="landingpagelg">Header</H1>
<H2 id="landingpagesm">Sub Header</H2>
</HEADER>

<BODY>
<div class="footerwrapper">
<div class="BFS">
<P>1st half</P>
</div>
<div class="BLFS">
<P>2nd half</P>
</div>
</div>
</script>

</html>

CSS:

a {
text-decoration: none;
}

body {
background-color: #161616;
}

header {
height: 100%;
background-image: url(http://i.imgur.com/11nVLmd.jpg);
background-size: cover;
background-position: center;
margin-bottom: 0;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
text-align: center
}

#landingpagelg {
font-family: Caviar Dreams;
font-size: 42px;
color: #FFF;
letter-spacing: 1px
}

#landingpagesm {
font-family: Caviar Dreams;
font-size: 21px;
color: #FFF
}

#CMSub {
min-width: 75px;
}

a {
color: #000;
}

a.hover {
color: 0000EE;
}

::selection {
background: #FFB870;
/*#CCCCCC*/
}

::-moz-selection {
background: #FFB870;
}

img::selection {
background: transparent
}

img::-moz-selection {
background: transparent
}

input {
width: 150px;
border: 1px solid;
border-radius: 6px;
height: 25px;
padding: 4px;
}

textarea {
border: 1px solid;
max-width: 500px;
max-height: 250px;
border-radius: 5px;
width: 250px;
height: 125px;
}

#github {
padding-right: 5px;
}

.footerwrapper {
width: 100%;
}

.BFS {
height: 150px;
width: 50%;
background-color: #161616;
}

.BLFS {
height: 150px;
width: 50%;
background-color: #99CCFF;
}

最佳答案

    .footerwrapper {
width: 100%;
display:flex;
}

Display Flex 解决了这个问题

关于HTML 在同一行显示两个 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31954885/

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