删除网页中的空白 - CSS 960.gs
Remove white spacing in webpage - CSS 960.gs
我目前正在从头开始开发我的投资组合网站。我读过一个名为“960.gs”的 CSS 框架,我用过类似的东西,但我以前从未使用过 CSS-pure 框架,所以我自然有点生疏。
无论如何,这是我的网站。我想删除顶部 "Title" 的两个段落之间的白色间距。我不确定是什么原因造成的,因为不可否认,我的 CSS 也有点生疏。
任何解决方案将不胜感激。
我的HTML:
<section class="container_12">
<article class="grid_9">
<h1>Title</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</article>
<aside class="grid_3 ">
<h1>More</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</aside>
<article class="grid_9">
<h1>Title</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</article>
<article class="grid_9">
<h1>Title</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</article>
</section>
我的CSS(目前很少):
@import url("nav.css");
@import url("960.css");
body {
}
a {
font-family:arial;
}
h1 {
}
h2 {
}
h3 {
}
h4 {
}
h5 {
}
/* MAIN CONTENT */
* {
}
.container {
margin:0 auto;
max-width:1100px;
width:90%;
}
960.gs CSS(激活码):
body {
min-width: 960px;
}
/* `Container
----------------------------------------------------------------------------------------------------*/
.container_12,
.container_16 {
margin-left: auto;
margin-right: auto;
width: 960px;
}
/* `Grid >> Global
----------------------------------------------------------------------------------------------------*/
.grid_1,
.grid_2,
.grid_3,
.grid_4,
.grid_5,
.grid_6,
.grid_7,
.grid_8,
.grid_9,
.grid_10,
.grid_11,
.grid_12,
.grid_13,
.grid_14,
.grid_15,
.grid_16 {
display: inline;
float: left;
margin-left: 10px;
margin-right: 10px;
}
/* `Grid >> 12 Columns
----------------------------------------------------------------------------------------------------*/
.container_12 .grid_1 {
width: 60px;
}
.container_12 .grid_2 {
width: 140px;
}
.container_12 .grid_4 {
width: 300px;
}
.container_12 .grid_5 {
width: 380px;
}
.container_12 .grid_7 {
width: 540px;
}
.container_12 .grid_8 {
width: 620px;
}
.container_12 .grid_10 {
width: 780px;
}
.container_12 .grid_11 {
width: 860px;
}
将右侧的列更改为向右浮动,这样应该会更好看。
aside.grid_3 {
float:right ;
}
您的 CSS 似乎没有为 grid_3 或 grid_9 提供宽度。此外,您没有指定要将 <aside>
浮动到任何地方的右边,(至少我能看到)
相应地设置宽度,like this fiddle here and it should function。
body {
width: 100%;
max-width: 960px;
}
aside {float:right; width:30%; max-width: 300px;}
article {float:left; width:60%; max-width: 600px;}
.clear {clear:both;}
这应该是一个很好的起点。
只需使用框架来构建主要布局(列等)。 Example
<main class="container_12">
<div id="main-column" class="grid_9">
...
</div>
<aside class="grid_3">
...
</aside>
</main>
而且您的 CSS 似乎没有为 grid_3 或 grid_9
提供宽度
我目前正在从头开始开发我的投资组合网站。我读过一个名为“960.gs”的 CSS 框架,我用过类似的东西,但我以前从未使用过 CSS-pure 框架,所以我自然有点生疏。
无论如何,这是我的网站。我想删除顶部 "Title" 的两个段落之间的白色间距。我不确定是什么原因造成的,因为不可否认,我的 CSS 也有点生疏。
任何解决方案将不胜感激。
我的HTML:
<section class="container_12">
<article class="grid_9">
<h1>Title</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</article>
<aside class="grid_3 ">
<h1>More</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</aside>
<article class="grid_9">
<h1>Title</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</article>
<article class="grid_9">
<h1>Title</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</article>
</section>
我的CSS(目前很少):
@import url("nav.css");
@import url("960.css");
body {
}
a {
font-family:arial;
}
h1 {
}
h2 {
}
h3 {
}
h4 {
}
h5 {
}
/* MAIN CONTENT */
* {
}
.container {
margin:0 auto;
max-width:1100px;
width:90%;
}
960.gs CSS(激活码):
body {
min-width: 960px;
}
/* `Container
----------------------------------------------------------------------------------------------------*/
.container_12,
.container_16 {
margin-left: auto;
margin-right: auto;
width: 960px;
}
/* `Grid >> Global
----------------------------------------------------------------------------------------------------*/
.grid_1,
.grid_2,
.grid_3,
.grid_4,
.grid_5,
.grid_6,
.grid_7,
.grid_8,
.grid_9,
.grid_10,
.grid_11,
.grid_12,
.grid_13,
.grid_14,
.grid_15,
.grid_16 {
display: inline;
float: left;
margin-left: 10px;
margin-right: 10px;
}
/* `Grid >> 12 Columns
----------------------------------------------------------------------------------------------------*/
.container_12 .grid_1 {
width: 60px;
}
.container_12 .grid_2 {
width: 140px;
}
.container_12 .grid_4 {
width: 300px;
}
.container_12 .grid_5 {
width: 380px;
}
.container_12 .grid_7 {
width: 540px;
}
.container_12 .grid_8 {
width: 620px;
}
.container_12 .grid_10 {
width: 780px;
}
.container_12 .grid_11 {
width: 860px;
}
将右侧的列更改为向右浮动,这样应该会更好看。
aside.grid_3 {
float:right ;
}
您的 CSS 似乎没有为 grid_3 或 grid_9 提供宽度。此外,您没有指定要将 <aside>
浮动到任何地方的右边,(至少我能看到)
相应地设置宽度,like this fiddle here and it should function。
body {
width: 100%;
max-width: 960px;
}
aside {float:right; width:30%; max-width: 300px;}
article {float:left; width:60%; max-width: 600px;}
.clear {clear:both;}
这应该是一个很好的起点。
只需使用框架来构建主要布局(列等)。 Example
<main class="container_12">
<div id="main-column" class="grid_9">
...
</div>
<aside class="grid_3">
...
</aside>
</main>
而且您的 CSS 似乎没有为 grid_3 或 grid_9
提供宽度