特定div的类应该在某处添加一些id

时间:2017-01-17 15:36:39

标签: html css

以下代码将灰色框应用于所有<divs>我想将该类应用于特定divs我是否应该在某处添加一些ID?

<!DOCTYPE html>
<html>
<head>
<style>
div {
    width: 320px;
    padding: 10px;
    border: 5px solid gray;
    margin: 0;
}
</style>
</head>
<body>

<h2>Calculate the total width:</h2>

<img src="klematis4_big.jpg" width="350" height="263" alt="Klematis">
<div>The picture above is 350px wide. The total width of this element is also 350px.</div>

</body>
</html>

enter image description here

3 个答案:

答案 0 :(得分:2)

ID(USE [DATABASE_NAME]; ),或者更好的是,可重用的类(USE [DATABASE_NAME]; IF DATABASE_PRINCIPAL_ID('role') IS NULL BEGIN -- add user here CREATE ROLE role AUTHORIZATION MyUser; END )适合于为此元素设置样式。

&#13;
&#13;
#idname
&#13;
.classname
&#13;
&#13;
&#13;

答案 1 :(得分:2)

"//div[@id='siteTable']..."

答案 2 :(得分:0)

你也可以试试这个:

<强> CSS

arr=(bold_rs_fabio_precuneus_mask.nii.gz mask.nii.gz 
bold_rs_fabio.nii.gz)
for f in $arr
do
    fslview $f &
done

<强> HTML

.newStyle {
    width: 320px;
    padding: 10px;
    border: 5px solid gray;
    margin: 0;
}

JAVA SCRIPT

<h2>Calculate the total width:</h2>

<img src="klematis4_big.jpg" width="350" height="263" alt="Klematis">
<div id="dvText">The picture above is 350px wide. The total width of this element is also 350px.</div>