473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Horizontally centering an image WITH a border

"WITH a border" being the defining issue.

Here's the deal: I'm new to CSS, but I've managed so far to center a single line of links at the top of my home page and center an image on the bottom of the browser window, such that the image will always stay glued to the bottom of the browser window no matter how big it is. Cool.

But here's the catch. I'd really like to have a solid, 10px, black border around the whole affair -- you know, hugging the edges of the browser window -- and for the life of me I can't figure out how to do it. I thought merely adding a border declaration in my CSS body tag would do it, but it don't. It only surrounds the line of text at the top. I assumed this was because the image was on the background, but even if I do bring it to the foreground in the body, a) I can't figure out how to simultaneously center it and glue it to the bottom of the browser window, and b) add the border.

My code so far is obviously brutally simple:

In my css file:

Expand|Select|Wrap|Line Numbers
  1. body {
  2.  
  3.     color: black;
  4.     background: white url('images/hisandhers_home_cropped.jpg') no-repeat fixed bottom;
  5.     text-align:center;
  6.     margin:0px 0px;
  7.     padding:0px;
  8.     font: 14pt "Lucida Sans Unicode", "Lucida Sans";
  9.  
  10.         }
  11.  
  12. .homelinks {
  13.  
  14.     margin-top: 20px;
  15.     text-align: center;
  16.  
  17.     }
  18.  
And in my index file:

Expand|Select|Wrap|Line Numbers
  1. <body>
  2.  
  3. <div class="homelinks">
  4. Creative Consultants | Photography | Photo Editing | Slideshows | Video | Writing
  5. </div>
  6.  
  7. </body>
  8.  
Thanks in advance.

Signed,

Vexed and curious in Dallas (a.k.a. Clint)
Jan 14 '07 #1
2 1487
drhowarddrfine
7,435 Expert 4TB
Take a look at this because I just drank something on an empty stomach and am really feeling woozy right now. :)

Then this for the border: "border:10px solid black" in the body. Make sure you are using a strict doctype so you aren't in quirks.
Jan 14 '07 #2
Take a look at this because I just drank something on an empty stomach and am really feeling woozy right now. :)

Then this for the border: "border:10px solid black" in the body. Make sure you are using a strict doctype so you aren't in quirks.
Sorry for not replying sooner; I never received an e-mail notice that anyone had replied to my post.

Thanks much for directing me to that. That might actually do the trick. (I haven't the time to try it tonight.) I ended up just putting it on the background layer without a border and going with that, but I'd still like to do the border if possible. We'll see what happens. Thanks again.

CH
Jan 26 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Faz | last post by:
Hi I'm having some real trouble with a header I have created within a container. I have two problems; firstly the menu (a horizontal UL) will not centre within the surrounding header, despite...
2
by: Lee K. Seitz | last post by:
I stayed up late working on a CGI script and spent some time formatting my page with CSS. It looked fine in IE, which will be 95% of my audience, so I went to bed. Got up and looked at it in...
6
by: Jerry Camel | last post by:
I want to center an image on the screen and have text centered over the image. What's the best way to do this? I've been playing with style tags and I can get the stuff to center automatically...
2
by: funkiejunkie | last post by:
Hello all, I posted a thread a while ago and was told to include the code so here it is. I still dont really get CSS, everything I have done has been blagged because I cant be bothered to read...
4
by: lister | last post by:
I am trying to center a DIV horizonally, but I want the DIV fluid so that it is just wide enough to encompass its contents. I've tried margin:auto with no joy :( I've set up a demo here:...
16
by: stevedude | last post by:
CSS newbie again. I have a problem trying to get coffee mug images within anchor tags to center with my link text for a vertical list menu. If I use the horizontal/vertical properties of...
16
by: Stan The Man | last post by:
I'm a CSS novice trying unsuccessfully to make three thumbnail images display horizontally instead of vertically. I suspect I'm missing something really stupid but I'll take the flak if someone...
1
by: =?Utf-8?B?ZnJhbmt5?= | last post by:
Hello, I've created a table that has two rows that are span across three columns. The third row has three columns, each with an image. The last row is also span accross three columns. The span...
4
by: harryusa | last post by:
I am trying to center 2 images concentrically which are z-indexed to lay on top of each other making an image with a border from another image that has a transparent center. I need the images to be...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.