gpt4 book ai didi

html - 列表不适用于 css 中的列,也不适用于 float

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

我正在处理我的个人页面。 我想从列表中创建列。
我怎样才能做到这一点 。 我尝试了网格和列,但没有用。出于某种原因,我正在考虑一个网络工具包。有什么建议 ?我还尝试 float margin 、 width 、 position 、 left 等等。我正式卡住了。我确实使用了 960 像素的最大值。那是走错路了吗?我也居中对齐我的页面吗?那也错了吗?

/*body  styles*/
body, html{background-color:#4B88A2;}
.grid-container{display:grid;
/*grid grid-template: 1fr repeat(11,10px 1fr);*/
grid-template-columns:[left-sidebar-start] 1fr 10px 1fr[right-sidebar-end]
10px
[main-area-start]1fr reapeat(11,[gutter] 10px [row]1fr[main-area-end])
10px
[right-sidebar-start] 1fr 10px 1fr [right-sidebar-end];
grid-template-rows: [header-start] 1fr[header-end]
10px
[main-start] 1fr[main-end]
[footer-start]1fr[footer-end]
}
/*.content-wrap{max-width:950px;
margin: 0 auto;overflow:auto;padding:60px 50px; }*/

html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}

/*headers*/
h1,h2{font-family:'lobster', cursive;
font-size:40px;font-weight: 400;}
h1{font-size:80px;}
h3{margin:0;}

header{text-align: center;}
header{padding-top: 60px;position:relative; }



h2 {
margin: 10px 0;

font-size: 40px;}
/*navigation*/
.nav{text-align:center;
position:fixed; top:0;width:100%;margin:0px; }

.nav a{display:inline-block;
padding:15px 20px;
text-decoration:none;
text-transform:uppercase;
font-weight:700;
}
.footer{position: fixed;
left:0; bottom:0;width:100%;
text-align:center; background-color:slategray;
display:block;}

/*columns*/
.column1{float:left;
width:900px;
marging:10px;}

.column2{float:left;
width:300px;margin:10px;}
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://fonts.googleapis.com/css?family=Lobster|Roboto" rel="stylesheet">
<link href="css/multiColumnTemplate.css" rel="stylesheet" type="text/css">

</head>


<body>

<header role="banner">

<nav role="navigation">
<div class="nav">
<a href="larry main.html">Home</a>
<a href="about.html">About</a>
<a href="portfolio.html">Portfolio</a>
<a href="#">Downloads</a>
<!-- Right navigation-->

</div>
</nav>


<div class="content-wrap">
<h1>Larry J Designs</h1>
<h2>Beginner web designer/ artist</h2>
<div class="about" id="about-me">
<p><img src="images/placeholder.jpg" alt="stock" style="width:100px;height:100px;"></p>
<p> Hello, I'm Larry J , I currently live in the DC Metro area , i also love working on art in my spare time.
As a teen in high I use to love to draw and build websites ,
Currently, I work a full time job like most , however in my spare time I love working on learning web design and drawing .
Life has a long road to success , but on the road there are that you have to learn to get to the next level . Here are mines bellow :</p></div></div>

</header>




<main role="main">

<section><!--my skill-->
<div class="content-wrap">

<div class="column1">
<h3>Skills in progress</h3>
<ul>

<li>HTML</li>
<li>CSS</li>
<li>Java script</li>
<li>J query</li>
</ul></div>


<div class="column2">
<h3>Next Skills to learn</h3>
<ul>
<li>Photoshop</li>
<li>Illustrator</li>
<li>Logo design</li>
<li>Graphic arts</li>
<li>T-shirt Design</li>
</ul>
</div></section>
</main>
<!--my skill-->



<!--skills list end-->

<!--container end-->
<div class="footer">
<p>&copy;Larry J designs </p>
</div>



</body>

`.

最佳答案

我用 display: inline-block 而不是 float 更新了你的 column1column2 CSS 并且它有效.我还将 width 设为百分比。

/*body  styles*/
body, html{background-color:#4B88A2;}
.grid-container{display:grid;
/*grid grid-template: 1fr repeat(11,10px 1fr);*/
grid-template-columns:[left-sidebar-start] 1fr 10px 1fr[right-sidebar-end]
10px
[main-area-start]1fr reapeat(11,[gutter] 10px [row]1fr[main-area-end])
10px
[right-sidebar-start] 1fr 10px 1fr [right-sidebar-end];
grid-template-rows: [header-start] 1fr[header-end]
10px
[main-start] 1fr[main-end]
[footer-start]1fr[footer-end]
}
/*.content-wrap{max-width:950px;
margin: 0 auto;overflow:auto;padding:60px 50px; }*/

html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}

/*headers*/
h1,h2{font-family:'lobster', cursive;
font-size:40px;font-weight: 400;}
h1{font-size:80px;}
h3{margin:0;}

header{text-align: center;}
header{padding-top: 60px;position:relative; }



h2 {
margin: 10px 0;

font-size: 40px;}
/*navigation*/
.nav{text-align:center;
position:fixed; top:0;width:100%;margin:0px; }

.nav a{display:inline-block;
padding:15px 20px;
text-decoration:none;
text-transform:uppercase;
font-weight:700;
}
.footer{position: fixed;
left:0; bottom:0;width:100%;
text-align:center; background-color:slategray;
display:block;}

/*columns*/
.column1{
display: inline-block;
width:calc(60%-10);
margin:10px;
vertical-align: top;
}

.column2{
display: inline-block;
width:calc(30%-10);
margin:10px;
vertical-align: top;
font-size:
}
.content-wrap {

}
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://fonts.googleapis.com/css?family=Lobster|Roboto" rel="stylesheet">
<link href="css/multiColumnTemplate.css" rel="stylesheet" type="text/css">

</head>


<body>

<header role="banner">

<nav role="navigation">
<div class="nav">
<a href="larry main.html">Home</a>
<a href="about.html">About</a>
<a href="portfolio.html">Portfolio</a>
<a href="#">Downloads</a>
<!-- Right navigation-->

</div>
</nav>


<div class="content-wrap">
<h1>Larry J Designs</h1>
<h2>Beginner web designer/ artist</h2>
<div class="about" id="about-me">
<p><img src="images/placeholder.jpg" alt="stock" style="width:100px;height:100px;"></p>
<p> Hello, I'm Larry J , I currently live in the DC Metro area , i also love working on art in my spare time.
As a teen in high I use to love to draw and build websites ,
Currently, I work a full time job like most , however in my spare time I love working on learning web design and drawing .
Life has a long road to success , but on the road there are that you have to learn to get to the next level . Here are mines bellow :</p></div></div>

</header>




<main role="main">

<section><!--my skill-->
<div class="content-wrap">

<div class="column1">
<h3>Skills in progress</h3>
<ul>

<li>HTML</li>
<li>CSS</li>
<li>Java script</li>
<li>J query</li>
</ul></div>


<div class="column2">
<h3>Next Skills to learn</h3>
<ul>
<li>Photoshop</li>
<li>Illustrator</li>
<li>Logo design</li>
<li>Graphic arts</li>
<li>T-shirt Design</li>
</ul>
</div></section>
</main>
<!--my skill-->



<!--skills list end-->

<!--container end-->
<div class="footer">
<p>&copy;Larry J designs </p>
</div>



</body>

此外,您的 css 代码中 58 行的 margin 属性名称有错字。

希望对你有帮助

最好的

关于html - 列表不适用于 css 中的列,也不适用于 float ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52141248/

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