所以我有一些定位问题。图像卡在文本上,我不知道如何正确移动它们。
This is what my page looks like.
This is what I want it to look like.
这是HTML:
<!DOCTYPE HTML>
<html>
<title>WS Esports Shop</title>
<link href="css/templatemo_style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="css/style.css"/>
<script src="js/javascript.js" type="text/javascript"></script>
<style>
h5{
text-align: right;
}
</style>
<head>
</head>
<body>
<div class="box">
<div>
<div class="logo">
<a href="index.html"><img src="images/logo.png" alt="West Sussex Esports" style="width:400px;height:125px;"/></a>
</div>
<br>
<ul>
<li><a href="news.html">News</a></li>
<li><a href="roster.html">Roster</a></li>
<li><a href="shop.html">Shop</a></li>
<li><a href="aboutus.html">About Us</a></li>
<li><a href="contact.html">Contact</a></li>
<li><a href="loginregister.html">Login</a></li>
</ul>
<br>
<div class="content">
<div class="section group">
<div class="col span_1_of_2">
<p><h2>Unisex T-Shirt</h2><h5>£19.99 </h5>
<img src="images/Tee.png" alt="Unisex T-Shirt" style="width:125px;height:125px;position:absolute;"/>
<div class="paypalbutton">
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="7TLGGK6SYD3UL">
<table>
<tr><td><input type="hidden" name="on0" value="Sizes">Sizes</td></tr>
<tr><td><select name="os0">
<option value="Small">Small </option>
<option value="Medium">Medium </option>
<option value="Large">Large </option>
</select> </td></tr>
</table>
<input type="image" src="https://www.paypalobjects.com/en_GB/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>
</div>
</div>
<div class="col span_1_of_2">
<p><h2>Snapback Cap</h2><h5>£14.99 </h5>
<img src="images/hat.png" alt="Snapback Hat" style="width:135px;height:125px;position:absolute;"/>
<div class="paypalbutton">
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="LE749TZGCRAGQ">
<input type="image" src="https://www.paypalobjects.com/en_GB/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>
</div>
</div>
</div>
<div class="section group">
<div class="col span_1_of_2">
<p><h2>Coffee Mug</h2><h5>£9.99 </h5>
<img src="images/mug.png" alt="Mug" style="width:135px;height:125px;position:absolute;"/>
<div class="paypalbutton">
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="TF9CJHY658JFA">
<input type="image" src="https://www.paypalobjects.com/en_GB/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>
</div>
</div>
<div class="col span_1_of_2">
<div class="paypalbutton">
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" >
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIG1QYJKoZIhvcNAQcEoIIGxjCCBsICAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCMfNX5RXwUrRKnoIgnp72k27NalKGcW1hyAfsInuMudOToDIdWwYalesmlET4WCrp1pFRqITvrCtMdFHqJg6NhLV6NFMOD/7+sKnu/qN6sQW6wQco2RxeW0boK8UF+uCA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wgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTUxMjE0MTUwNTUwWjAjBgkqhkiG9w0BCQQxFgQUVHYa+z9aGS5d7Jg7HKs+Q289beQwDQYJKoZIhvcNAQEBBQAEgYCpT8KZSSoxPsVPHVrGSJkBycfdx/bV7N4Un5C6m700VbAA7ipaTGXYk6ILcV6BWnVBnWS6l1xOU/87P9SiPpEKPpzb87+s/hW26lNOVB/zQP0v/ejqW2kNu9EN7Pl/aKgXK2FB391nK9cMmv4jTPnWUqMz8VrdCTHEfBNih6NWmw==-----END PKCS7-----
">
<input type="image" src="https://www.paypalobjects.com/en_GB/i/btn/btn_viewcart_LG.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
这是CSS:
@import '../../shared/mixins',
'../../shared/reset',
'../../shared/about-light';
body {
font: 13px/20px 'Lucida Grande', Tahoma, Verdana, sans-serif;
background-color: gray;
}
div.box{
background-color: lightgray;
width:900px;
height:120%;
margin-top:10px;
margin-bottom:10px;
margin:auto;
}
div.logo{
margin-left:235px;
margin-top:10px;
position:absolute;
}
div.content{
align: center;
margin-left:20px;
margin-right:20px;
margin-top:10px;
}
ul{
align: centre;
display: inline-block;
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
text-align: center;
margin-top:130px;
}
li {
float: left;
}
li>a:link, a:visited {
display: block;
width:140px;
font-weight: bold;
color: red;
background-color: darkgrey;
padding: 5px;
text-decoration: none;
}
li>a:hover {
background-color: grey;
}
/* SECTIONS */
.section {
clear: both;
padding: 0px;
margin: 0px;
}
/* COLUMN SETUP */
.col {
display: block;
float:left;
margin: 1% 0 1% -0.5%;
border: 5px solid darkgray;
}
.col:first-child { margin-left: 0; }
/* GROUPING */
.group:before,
.group:after { content:""; display:table; }
.group:after { clear:both;}
.group { zoom:1; /* For IE 6/7 */ }
/* GRID OF TWO */
.span_2_of_2 {
width: 100%;
}
.span_1_of_2 {
height: 200px;
width: 49%
}
/* GO FULL WIDTH AT LESS THAN 480 PIXELS */
@media only screen and (max-width: 480px) {
.col {
margin: 1% 0 1% 0%;
}
}
@media only screen and (max-width: 480px) {
.span_2_of_2, .span_1_of_2 { width: 100%; }
}
.paypalbutton{
text-align:right;
}
@media screen and (min-width:341px) and (max-width:768px) {
.paypalbutton {
text-align:center;
}
}
.container {
margin: 80px auto;
width: 640px;
}
.login {
position: relative;
margin: 0 auto;
margin-top:20px;
margin-bottom:20px;
padding: 20px 20px 20px;
width: 310px;
background: white;
border-radius: 3px;
@include box-shadow(0 0 200px rgba(white, .5), 0 1px 2px rgba(black, .3));
&:before {
content: '';
position: absolute;
top: -8px; right: -8px; bottom: -8px; left: -8px;
z-index: -1;
background: rgba(black, .08);
border-radius: 4px;
}
h1 {
margin: -20px -20px 21px;
line-height: 40px;
font-size: 15px;
font-weight: bold;
color: #555;
text-align: center;
text-shadow: 0 1px white;
background: #f3f3f3;
border-bottom: 1px solid #cfcfcf;
border-radius: 3px 3px 0 0;
@include linear-gradient(top, whiteffd, #eef2f5);
@include box-shadow(0 1px #f5f5f5);
}
p {
margin: 20px 0 0;
}
p:first-child {
margin-top: 0;
}
input[type=text], input[type=password] {
width: 278px;
}
p.remember_me {
float: left;
line-height: 31px;
label {
font-size: 12px;
color: #777;
cursor: pointer;
}
input {
position: relative;
bottom: 1px;
margin-right: 4px;
vertical-align: middle;
}
}
p.submit { text-align: right; }
}
.login-help {
margin: 20px 0;
font-size: 11px;
color: white;
text-align: center;
text-shadow: 0 1px #2a85a1;
a {
color: #cce7fa;
text-decoration: none;
&:hover { text-decoration: underline; }
}
}
:-moz-placeholder {
color: #c9c9c9 !important;
font-size: 13px;
}
::-webkit-input-placeholder {
color: #ccc;
font-size: 13px;
}
input {
font-family: 'Lucida Grande', Tahoma, Verdana, sans-serif;
font-size: 14px;
}
input[type=text], input[type=password] {
margin: 5px;
padding: 0 10px;
width: 200px;
height: 34px;
color: #404040;
background: white;
border: 1px solid;
border-color: #c4c4c4 #d1d1d1 #d4d4d4;
border-radius: 2px;
outline: 5px solid #eff4f7;
-moz-outline-radius: 3px; // Can we get this on WebKit please?
@include box-shadow(inset 0 1px 3px rgba(black, .12));
&:focus {
border-color: #7dc9e2;
outline-color: #dceefc;
outline-offset: 0; // WebKit sets this to -1 by default
}
}
input[type=submit] {
padding: 0 18px;
height: 29px;
font-size: 12px;
font-weight: bold;
color: #527881;
text-shadow: 0 1px #e3f1f1;
background: #cde5ef;
border: 1px solid;
border-color: #b4ccce #b3c0c8 #9eb9c2;
border-radius: 16px;
outline: 0;
@include box-sizing(content-box); // Firefox sets this to border-box by default
@include linear-gradient(top, #edf5f8, #cde5ef);
@include box-shadow(inset 0 1px white, 0 1px 2px rgba(black, .15));
&:active {
background: #cde5ef;
border-color: #9eb9c2 #b3c0c8 #b4ccce;
@include box-shadow(inset 0 0 3px rgba(black, .2));
}
}
.lt-ie9 {
input[type=text], input[type=password] { line-height: 34px; }
}