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.

Centering banner

Featured Replies

Hi,

 

I'm trying to get a wide banner to centre and hide the overflow. I have managed to do this, and in google on my laptop it looked fine. However, other people have opened the page and the banner is showing in the header and is left aligned.

 

This is my first post on here and I'm a very new into the world of website design. I have been on browser shots and most of the screenshots have come back with the banner in the header.

 

What do I need to post for someone to be able to help me?

 

Many thanks

 

Lorraine

post a link to the website

 

Your problem is probably browsers displaying the website differently.

 

Browser A may display it properly as it's standards compliant, where Browser B won't cos it's outdated.

What do I need to post for someone to be able to help me?

 

Post a link to your live website, then we can see the problem and pick up the html & css

  • Author

Thanks.

 

The URL is http://www.loanresolutions.co.uk/index_new.html

 

The top should be white - where the logo and menu is. But for some reason on all the browser shots there is a banner in the background. I'm viewing on IE and looks fine to me and properly spaced out. But a friend viewed using IE and it looked terrible.

Thanks.

 

The URL is http://www.loanresolutions.co.uk/index_new.html

 

The top should be white - where the logo and menu is. But for some reason on all the browser shots there is a banner in the background. I'm viewing on IE and looks fine to me and properly spaced out. But a friend viewed using IE and it looked terrible.

 

displays fine in ie7, looks awful in firefox

 

gimme 5 mins and will look at the code

remove this from the html at the top

 

<style type="text/css">
<!--
body {
background-image: url(main_area.gif);
background-repeat: no-repeat;
}
-->
</style>

firefox your graphics are WAY TOO BIG. try doing a conditional statement

 

<!--ifIE--> (not sure if i'm writing that correctly)

link to ie stylesheet

<!--end ifIE-->

 

That way if it looks good in IE you can keep it that way and mess with the css for Firefox et al.

  • Author

Hi,

 

How did that image get in there?? I have removed the gif within the html code. Can you have another look at it?

 

My images are too big? Do you mean in measurement size or file size?

 

Many thanks

 

Lorraine

You're also losing some of your text in the footer (IE8 FF3.5)

  • Author

Am I trying to be too clever? I just had a screen dump sent by someone and the titles are going out of line too.

 

This is my first attempt at CSS. My previous website (don't shout at me!) was done entirely in photoshop. I know the countless reasons why this is not a good idea. So I have spent a bit of time recently looking at tutorials and getting my head around it.

 

Any suggestions to clean thing up?

Am I trying to be too clever? I just had a screen dump sent by someone and the titles are going out of line too.

 

This is my first attempt at CSS. My previous website (don't shout at me!) was done entirely in photoshop. I know the countless reasons why this is not a good idea. So I have spent a bit of time recently looking at tutorials and getting my head around it.

 

Any suggestions to clean thing up?

 

run the website through http://validator.w3.org

 

The websit is really nice but does need some work to clean it up and make it readable.

 

You have the footer height set to 100px, remove that.

 

Add the following just before the end div of the footer.

 

<br class="clear" />

 

In the css add

 

.clear { clear:both; } 

  • Author

Thank you.

 

I tried the validator and it had a problem with border=0 in my html code. No idea why. I think it threw up about 6 errors. CSS was more I belive but it does need tidying up. There's probably stuff in there that I need to delete - it's been a bit of a self-tutorial this website.

 

I will amend the footer height, thanks

 

Any idea why my titles (which are images - the h2 headers are indented off the page) are mis-aligning on some browsers?

I tried the validator and it had a problem with border=0 in my html code. No idea why.

 

It's because you've declared a Strict Doctype. Try Transitional XHTML if you need to add inline styling like this.

Thank you.

 

I tried the validator and it had a problem with border=0 in my html code. No idea why. I think it threw up about 6 errors. CSS was more I belive but it does need tidying up. There's probably stuff in there that I need to delete - it's been a bit of a self-tutorial this website.

 

I will amend the footer height, thanks

 

Any idea why my titles (which are images - the h2 headers are indented off the page) are mis-aligning on some browsers?

 

Border:0; isn't a good idea, use border:none; <_<

 

your h2 code has the following.

text-indent: -9999px;

 

That should only be used when you want to hide the text from the users, but Ie will still show it (in ie6). The best bet I find is to add, display:none; if you want to hide it.

  • Author

It's because you've declared a Strict Doctype. Try Transitional XHTML if you need to add inline styling like this.

 

Ah - I don't really understand which one I should be using. I was just opening an HTML file in Dreamweaver and not even looking at that. Then I saw a tutorial which said to use Strict.

 

Is there an article anywhere that explains the differences?

Any idea why my titles (which are images - the h2 headers are indented off the page) are mis-aligning on some browsers?

 

Your H2 is a block-level container, and the <img> you've used for the title appears below this, then the #UCA div is width 300px and floated left, so the pushed-down image will wrap to the #UCA container.

 

How about giving the H2 an ID and using CSS to set the image as a background image? You can then remove the <img> and all should be well.

Ah - I don't really understand which one I should be using. I was just opening an HTML file in Dreamweaver and not even looking at that. Then I saw a tutorial which said to use Strict.

 

Is there an article anywhere that explains the differences?

 

Try:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

 

http://24ways.org/2005/transitional-vs-strict-markup

  • Author

Border:0; isn't a good idea, use border:none; <_<

 

your h2 code has the following.

text-indent: -9999px;

 

That should only be used when you want to hide the text from the users, but Ie will still show it (in ie6). The best bet I find is to add, display:none; if you want to hide it.

 

Again - something I picked up from a tutorial. Most web-design tuts seem to suggest doing that. Display:none does seem to make more sense.

 

Thanks again.

  • Author

Try:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

 

http://24ways.org/2005/transitional-vs-strict-markup

 

Thank you.

 

Nice website. I notice that you have your twitter feed in a different format to that horrible box that they give you code for. I can't seem to find the area in twitter that enables you to get the html/javascript code so that you can format the layout of the text.

  • Author

Your H2 is a block-level container, and the <img> you've used for the title appears below this, then the #UCA div is width 300px and floated left, so the pushed-down image will wrap to the #UCA container.

 

How about giving the H2 an ID and using CSS to set the image as a background image? You can then remove the <img> and all should be well.

 

Can I do that as I have about 6 different H2 headers?

Thank you.

 

Nice website. I notice that you have your twitter feed in a different format to that horrible box that they give you code for. I can't seem to find the area in twitter that enables you to get the html/javascript code so that you can format the layout of the text.

 

Thanks...I'm using a WordPress plugin to grab the latest tweet, which then displays the feed in a minimal format...then CSS works the magic :)

Can I do that as I have about 6 different H2 headers?

 

Of course, just give each one a different ID. My own website uses this for the graphic page title you see in the top-left of the content window on each page, for example:

 

<h2 id="postID-21" class="pageTitle">
   <span class="postTitleImage">
       <span class="postTitleText">Magento</span>
   </span>
</h2>

  • Author

Thanks...I'm using a WordPress plugin to grab the latest tweet, which then displays the feed in a minimal format...then CSS works the magic :)

 

I might save that for another day! I'm no web designer by any stretch, BUT I do find it extremely interesting and think that what is done these days on some websites is just amazing. There's also great community of people willing to share their knowledge and help other people.

  • Author

Of course, just give each one a different ID. My own website uses this for the graphic page title you see in the top-left of the content window on each page, for example:

 

<h2 id="postID-21" class="pageTitle">
   <span class="postTitleImage">
       <span class="postTitleText">Magento</span>
   </span>
</h2>

 

Oh yes of course. h2 id, class and span - it's things like this that I'm still getting my head round. However, when I find a website that I like, I look at their coding to find out how things are done.

 

I still have some things that I want to change with the design so I'll make the suggested changes and try and get it finished.

Transitional is more forgiving. W/ strict you need to keep to the exact code.

  • 2 weeks later...
  • Author

Hello again,

 

I'm trying to do what has been suggested before and if I hide the h2, it also hides the background. Is there a simple way of having an image for a title on a page, where the text is picked up by google, but the actual HTML text is not seen by the viewer?

 

thanks in advance

  • Author

Hello again,

 

I'm trying to do what has been suggested before and if I hide the h2, it also hides the background. Is there a simple way of having an image for a title on a page, where the text is picked up by google, but the actual HTML text is not seen by the viewer?

 

thanks in advance

 

Never mind! I've sorted it out - somehow.

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.