Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-10-2010, 09:02 PM   PM User | #1
okkzz
New to the CF scene

 
Join Date: Nov 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
okkzz is an unknown quantity at this point
Question Align 125x125 ads ?

Hello, I'm making a blog on which I want to put 125x125 ads.
I'm facing a problem tho, I want my 4 ads to be like this:


And what I get is this :


With the following code :
Code:
<script type="text/javascript" charset="utf-8" src="http://ads.advertisespace.com/AA/Jf/qG.js"></script><p style="padding:0;margin:0;line-height:12px;font-size:10px;width:125px;text-align:center;color:#2AB8E7;"><a href="http://www.advertisespace.com/?a=AAFcJL" style="color:#2AB8E7;">Advertising Online</a></p>
 
<script type="text/javascript" charset="utf-8" src="http://ads.advertisespace.com/AA/Jf/qG.js"></script><p style="padding:0;margin:0;line-height:12px;font-size:10px;width:125px;text-align:center;color:#2AB8E7;"><a href="http://www.advertisespace.com/?a=AAFcJL" style="color:#2AB8E7;">Advertising Online</a></p>
 
<script type="text/javascript" charset="utf-8" src="http://ads.advertisespace.com/AA/Jf/qG.js"></script><p style="padding:0;margin:0;line-height:12px;font-size:10px;width:125px;text-align:center;color:#2AB8E7;"><a href="http://www.advertisespace.com/?a=AAFcJL" style="color:#2AB8E7;">Advertising Online</a></p>
 
<script type="text/javascript" charset="utf-8" src="http://ads.advertisespace.com/AA/Jf/qG.js"></script><p style="padding:0;margin:0;line-height:12px;font-size:10px;width:125px;text-align:center;color:#2AB8E7;"><a href="http://www.advertisespace.com/?a=AAFcJL" style="color:#2AB8E7;">Advertising Online</a></p>

How can I do it ?
Thanks !
okkzz is offline   Reply With Quote
Old 11-10-2010, 10:17 PM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello okkzz,
Using floats is how you put thing beside each other. The natural flow of a float is to drop to the next line when there is not enough room for it. By putting the 4 floats in a container and specifying a width that is wide enough for 2 of them (plus their margins) you can make your 4 ads form a square.

Try it like this:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.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>
<style type="text/css">
html, body {background: #000;}
#wrapper {
	width: 270px;
	margin: 50px auto;
	overflow: auto; /*to clear the floats*/
	background: #ff0; /*a bg color for demonstration only*/
}
p {
	width: 125px;
	margin: 5px;
	padding: 0;
	float: left;
	line-height: 12px;
	font-size: 10px;
	text-align: center;
	color: #2AB8E7;
}
</style>
</head>
<body>
    <div id="wrapper">
		<p><script type="text/javascript" charset="utf-8" src="http://ads.advertisespace.com/AA/Jf/qG.js"></script><a href="http://www.advertisespace.com/?a=AAFcJL" style="color:#2AB8E7;">Advertising Online</a></p> 
        <p><script type="text/javascript" charset="utf-8" src="http://ads.advertisespace.com/AA/Jf/qG.js"></script><a href="http://www.advertisespace.com/?a=AAFcJL" style="color:#2AB8E7;">Advertising Online</a></p> 
        <p><script type="text/javascript" charset="utf-8" src="http://ads.advertisespace.com/AA/Jf/qG.js"></script><a href="http://www.advertisespace.com/?a=AAFcJL" style="color:#2AB8E7;">Advertising Online</a></p> 
        <p><script type="text/javascript" charset="utf-8" src="http://ads.advertisespace.com/AA/Jf/qG.js"></script><a href="http://www.advertisespace.com/?a=AAFcJL" style="color:#2AB8E7;">Advertising Online</a></p>
    <!--end wrapper--></div>
</body>
</html>
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 11-10-2010, 11:45 PM   PM User | #3
okkzz
New to the CF scene

 
Join Date: Nov 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
okkzz is an unknown quantity at this point
Thanks a lot it's working like a charm

Sorry for this noobish question, I'm using a blogger template, and trying hard to make a nice blog but it's complicated as I have no clue about coding

So thanks
okkzz is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:58 AM.


Advertisement
Log in to turn off these ads.