开发者

CSS box being cut off?

i have put in a css box colored red and for some reason the very bottom left is cut off is there an explanation (picture below)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="http://cdn.jquerytools.org/1.2.4/full/jquery.tools.min.js"></script>
<style type="text/css">
<!--
#test {
    background-color: #F00;
    height: 375px;
    width: 69%;
}

.imz{
    margin-bottom:-1%;

}

-->
</style></head>

<body>

<!-- the tabs -->
<span class="tabs">
    <a href="#"><img src="../../images/security_tabs.png" class="imz" style="float: left;"开发者_JS百科 /></a>
    <a href="#"><img src="../../images/security_tabs.png" class="imz" /></a>
    <a href="#"><img src="../../images/security_tabs.png" class="imz" /></a>
</span>

<div id="test">
<!-- tab "panes" -->
<div class="panes">
    <div>First tab content. Tab contents are called "panes"</div>

    <div>Second tab content</div>
    <div>Third tab content</div>
</div>
<div id="test">
</div>

<!-- This JavaScript snippet activates those tabs -->
<script>

// perform JavaScript after the document is scriptable.
$(function() {
    // setup ul.tabs to work as tabs for each div directly under div.panes
    $("span.tabs").tabs("div.panes > div");
});
</script>

</body>
</html>

CSS box being cut off?


You've a second <div id="test">. Get rid of it.


You have two opening divs with ID="test" so your CSS rule #test {width: 69%;} is being applied twice.


It's the width: 69%; that's causing it. Because you've got two divs with id=test the 69% is only applying to the second one. Don't use ids on more than one element.


Beside that you have some other css problem too, try this code ,its tested

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="http://cdn.jquerytools.org/1.2.4/full/jquery.tools.min.js"></script>
<style type="text/css">
#test {
    background-color: #F00;
    height: 375px;
    width: 69%;
}

.imz{
    margin-bottom:-1%;
}
.tabs a{
float:left;
display:block;
}
#test{
clear:both;
}
</style></head>

<body>

<!-- the tabs -->
<span class="tabs">
    <a href="#">afs<img src="../../images/security_tabs.png" class="imz"/></a>
    <a href="#">asdf2<img src="../../images/security_tabs.png" class="imz" /></a>
    <a href="#">asdf3<img src="../../images/security_tabs.png" class="imz" /></a>
</span>

<div id="test">
<!-- tab "panes" -->
<div class="panes">
    <div>First tab content. Tab contents are called "panes"</div>
    <div>Second tab content</div>
    <div>Third tab content</div>
</div>

<!-- This JavaScript snippet activates those tabs -->
<script>

// perform JavaScript after the document is scriptable.
$(function() {;
    // setup ul.tabs to work as tabs for each div directly under div.panes
    $("span.tabs").tabs("div.panes > div");
});
</script>

</body>
</html>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜