Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Div positioning trouble

Featured Replies

Hi guys,

 

Forgive me if this is really obvious, but I'm at a blank.

 

I have a div that won't position as I think it should (http://www.theowlandthepussycatx.com/wip.html), it's the div that contains "Something". If I add a top border to it, it drags everything down with it.

 

I'll post the code too, though don't mention the fact that all CSS is inline, as it's still just being designed and developed at the minute.

 

<html>
<head>
<title>The Owl & the Pussycat Piercing</title>
<link href='http://fonts.googleapis.com/css?family=League+Script' rel='stylesheet' type='text/css'>
<style type="text/css">
a.nav:link {color:#000;font-weight:bold;text-decoration:none;font-size:18pt;}
a.nav:visited {color:#000;}
a.nav:hover {color:#ee78a7;}
</style>
</head>
<body style="background-image:url('tile.png');background-repeat:repeat;margin:0px;">
<div style="width:100%;">
<div style="height:155px;width:100%;background-color:#fff;-moz-box-shadow: 0 0 10px pink;-webkit-box-shadow: 0 0 10px pink;box-shadow: 0 0 10px pink;opacity:0.7;">
<div style="width:900px;margin:0 auto;">
<div style="float:right;">
<div>
<h1 style="line-height:10px;"><img src="navlogo.png"></h1>
<p style="line-height:10px;font-style:italic;text-align:right;">Unit 11, The Forum. 127 Devonshire Street, Sheffield, S3 7SB</p>
</div>
<p style="line-height:10px;text-align:right;">
<a class="nav" href="#">Home</a>   
<a class="nav" href="#">Info</a>   
<a class="nav" href="#">Prices</a>   
<a class="nav" href="#">Gallery</a>   
<a class="nav" href="#">Contact</a>
</p>
</div>
</div>
<div style="width:900px;background-color:#fff;margin:0 auto;">
Something
</div>
</div>
</body>
</html>

 

Many thanks,

 

Oliver

Can you try closing this div for me and see if that solves the problem :)

 

EDIT: Add clear:both to your div style on line 30 as well please if you don't like for that div to stay on the top which is what I think you wanted.

 

post-32989-0-84683800-1334753088_thumb.png

Edited by rrr

  • Author

Can you try closing this div for me and see if that solves the problem :)

 

EDIT: Add clear:both to your div style on line 30 as well please if you don't like for that div to stay on the top which is what I think you wanted.

 

post-32989-0-84683800-1334753088_thumb.png

 

Sincerest *embarrassed* thanks. Never again shall such a grave error be made. I must start indenting my work...

I'm better at spotting the mistakes that I make as well :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.