本文介绍了为什么我的类ID标签不工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我的网站:





我有两个问题。



1.我不知道为什么侧边栏导航中的文本不是黑色的!它是蓝色的。

  #side_wrapper_text a:link {
font-family:'Playfair Display',sans-serif ;
font-size:32px;
font-style:italic;
font-weight:100;
color:rgba(255,255,255,1);
text-decoration:none;
text-align:right;
letter-spacing:0.2em;

}

2.我想让文本在其框的顶部精确对齐,我不知道为什么它只是不自动做。我试着玩行距选项无法使用。

  / * CONTENT ********************* ********************************* / 

.content_wrapper {
float : 剩下;
width:980px;
margin-left:15px;
margin-top:45px;

}
/ *主页上的照片框************************ /

.home_photo {
display:block;
height:400px;
background:rgba(0,0,255,.5);

}

/ *主页上的文本框* /

.home_text {
display:block;
float:left;
background:rgba(255,100,255,.5);
height:190px;
text-align:left;
}

/ * WRITING ********************************** ***** /

.home_writing {
display:block;
background:rgba(50,50,50,.5);
height:1000px;
text-align:left;
}

谢谢!

解决方案

对于问题#1,删除rgba和下面的括号之间的空格,即 color:rgba(255,255,255,1)



在Chrome 25中,这会使颜色为白色,而不是黑色(预期)。如果你想要黑色,只需使用 color:#000; color:rbga(0,0,0,1); 对于问题#2:< p> 标签的边距大约为1em,由浏览器的默认样式表设置。



示例:

  P {margin:0; } 

您也可以考虑使用以规范浏览器的行为,并重置浏览器默认样式表设置的许多样式。



  * {padding:0);或者至少将所有填充/边距重置为零(修正了许多常见问题) ; margin:0; } 


Here's my website:

http://violetoeuvre.com/

I have two questions.

1. I can't figure out why the text in the sidebar navigation isn't black! It's blue instead.

#side_wrapper_text a:link{
        font-family: 'Playfair Display', sans-serif;
        font-size: 32px;
        font-style: italic;
        font-weight: 100; 
        color:rgba (255,255,255,1);
        text-decoration: none; 
        text-align: right;
        letter-spacing:0.2em;

}

2. I want the text to align EXACTLY at the top of its box, and I can't figure out why it just doesn't do that automatically. I tried playing with line spacing options to no avail.

/* CONTENT ********************************************************/

.content_wrapper {
    float: left; 
    width: 980px;
    margin-left: 15px;
    margin-top: 45px;

}
/* Photo Box on Home Page ************************/

.home_photo { 
        display:block;
        height: 400px;
        background: rgba(0,0,255, .5);

}

/* Text Box on Home Page */

.home_text{ 
        display:block;
        float: left;
        background: rgba(255,100,255,.5);
        height: 190px;
        text-align: left;
}

/* WRITING ***************************************/

.home_writing {
    display: block;
    background: rgba(50,50,50,.5);
    height: 1000px;
    text-align: left;
}

Thank you!

解决方案

For problem #1, remove the space between "rgba" and the following parenthesis, i.e. color: rgba(255,255,255,1).

In Chrome 25, this then made the color white, not black (to be expected). If you want black, just use color: #000; or color: rbga(0,0,0,1); if you want to specify the alpha channel for some reason.

For problem #2: The paragraph <p> tags have a margin of roughly 1em set by the browser's default stylesheet. Set it to zero (or some other value) to modify.

Example:

P { margin: 0; }

You might also consider using a reset stylesheet to normalize behavior across browsers and reset many of the styles set by the browser's default stylesheet.

Or at least reset all padding/margin to zero (which fixes many of the common problems):

* { padding: 0; margin: 0; }

这篇关于为什么我的类ID标签不工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 00:16