1

我无法弄清楚这个填充。我想去掉我主页 claireisabelwebb.com 上照片周围的细微顶部和左侧填充。

这是我的CSS:

/* Wrapper for Text and Photo on Home Page */

.wrapper_text_photo{ 
        display:block;
        /* float: left; */
        position: fixed;;
        background: rgba(0,0,255, 0);
        height: 800px;
        padding-top: 3px;
        padding-left: 10 px;
        margin-top:20px;
        /* margin-left:100px;*/
        margin-left:55px;
        /* margin-left:100px;*/
        margin-top: 232px;
}

/* Photo on Home Page */

.photo_home {
        float: left;
        margin-right:10px;
        padding-left: 10px;
        padding-top: 10px;
        background: rgba(0,0,255, 0);
}

/* Text on Home Page */

.home_text{ 
        display:block;
        position: fixed;
        background: rgba(255,255,255,.85);
        width:1100px;
        height: 480px;
        margin-left: 300px;
        padding-left: 10px;
        padding-right: 5px;

}
.home_text p img {
    float:left;
    background: rgba(255,255,255, .85);
}

和html:

    <!-- Text and Photo __________________________________________-->

<div class="wrapper_text_photo">

    <div class="home_text">
            <p><img class="photo_home" src="http://claireisabelwebb.com/images/Home/claire-ed.jpg" alt="person_name" height="280px" />I graduated in YYYY from XXXX College with departmental honors in SUBJECT. As a junior, I participated in a XXXX mission in PLACE. <br><br>
            Email me at someemail@someemail.com.
            <br> 
            &raquo;try scrolling this page up and down&laquo;
            </p>
    </div>
</div>

我很难看到包装器的边距和内边距在哪里,以及它如何与每个元素(照片和文本框)的内边距和边距相互作用。这是编码的正确方法吗?

谢谢!!

4

2 回答 2

0
.photo_home {
    ...
    padding-left: 10px;
    padding-top: 10px;
    ...
}

这不会碰巧与它有任何关系,不是吗?尝试删除那里的填充线。

于 2013-03-19T16:33:40.940 回答
0

You are adding padding. If you don't want the padding to show a background, you have two options.

Switch it to margin:

.photo_home {
    float: left;
    margin: 10px 10px 0 10px;
    background: rgba(0, 0, 255, 0);
}

or use this style for background transparency:

.photo_home {
    float: left;
    margin-right: 10px;
    padding-left: 10px;
    padding-top: 10px;
    background: transparent;
}

enter image description here

于 2013-03-19T16:42:35.167 回答