小编Esh*_*sha的帖子

为每个HTML页面制作单独的CSS文件是个好主意吗?

我正在建立一个个人主页。我有4个HTML页面,并且所有页面只有一个CSS链接表。也就是说,在一个CSS文件中,我为所有不同的页面设置了布局。[实际上,每个页面的布局几乎相同,只是内容和样式看起来不同。我的网站并没有那么进步。]

这是一个好习惯吗?或者我应该为每个页面创建单独的CSS?

我所做的一个例子:

page-1.html:

<link rel="stylesheet" type="text/css" href="design.css">
Run Code Online (Sandbox Code Playgroud)

page-2.html:

<link rel="stylesheet" type="text/css" href="design.css">
Run Code Online (Sandbox Code Playgroud)

design.css:

/*
.......
*/
Run Code Online (Sandbox Code Playgroud)

html css html5 css3 web

7
推荐指数
2
解决办法
2万
查看次数

如何并排放置两个段落(彼此相邻)?

我有两个由父div包装的div容器.每个子div包含带标题的段落.如果我尝试将这两个段落(包括标题)在同一行中彼此相邻,它们就不会停留.他们只是分解并坐在其他人的下面. 如何将它们彼此相邻,并且从顶部开始保持相同的余量?

注意我总是希望保留与第一段演示中显示的文本数量相同的文本.

HTML:

    <div id="gallery-text">

    <div id="gallery-text-left" style="float:left">
    <p id="gallery-text-quote-left" style="font-family:Century Gothic; color:#006600"><b>I am not interested in shooting new things, I am interested to see things new.</b></p>

    <p id="gallery-paragraph-1" style="font-family:Georgia">
    bodybodybodybodybodybodybodybodybodybodybodybodybodybody
    bodybodybodybodybodybodybodybodybodybodybodybodybodybody
    bodybodybodybodybodybodybodybodybodybodybodybodybodybody
    </p>
    </div>
    <div id="gallery-text-right" style="float:left">
    <p id="gallery-text-quote-right" style="font-family:Century Gothic; color:#006600"><b>External photo albums</b></p>
    <p id="gallery-paragraph-2" style="font-family:Georgia">
    <a>Link coming soon</a>
    </p>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

.CSS:

 #gallery-text-left{
}
#gallery-paragraph-1{
border-left:8px solid #3CB371;
border-radius:4px;
padding-left:15px;
}
#gallery-paragraph-2{
border-left:8px solid #3CB371;
border-radius:4px;
padding-left:15px;
}
#gallery-text-right{
}
Run Code Online (Sandbox Code Playgroud)

请看看我的演示.

html css html5 css3

5
推荐指数
1
解决办法
3万
查看次数

标签 统计

css ×2

css3 ×2

html ×2

html5 ×2

web ×1