13 replies [Last post]
maryjane9110024
maryjane9110024's picture
Offline
Regular
Phoenix, AZ
Last seen: 12 years 6 days ago
Phoenix, AZ
Timezone: GMT-7
Joined: 2007-12-27
Posts: 35
Points: 0

How do I / is it possible to have a footer div with a black background and a green (or any other color) 1px line "draw" horizontally accross the page?

OR

There is currently an image in place but there an approximate 4 or 5px gap between the end of the line and the browser. Is there a way to eliminate the gap?

Here's the CSS currently in place:

#footer {
	background:url(../images/footer-bg.jpg) repeat-x;
	margin-top:10px;
	z-index:6;
}
#footerPan {
	width:900px;
	z-index:7;
}

David Laakso
David Laakso's picture
Offline
Enthusiast
US
Last seen: 12 years 4 weeks ago
US
Joined: 2008-07-18
Posts: 265
Points: 0

Regarding your 1st question,

Regarding your 1st question, yes it is possible. Nest one division within another. Assign a border-bottom to the inner division. Please see:

http://www.chelseacreekstudio.com/ca/cssd/line.htm

This page will be permanently deleted both off and online on July 27, 2008.

maryjane9110024
maryjane9110024's picture
Offline
Regular
Phoenix, AZ
Last seen: 12 years 6 days ago
Phoenix, AZ
Timezone: GMT-7
Joined: 2007-12-27
Posts: 35
Points: 0

sweet deal!

Thank you. I'm going to add the code below so that others can view it after July 27th.

Thanks again!!

<style type="text/css">
html,body {background:#fff; color:#000;margin:0;padding:0;}
body {font: 100% Georgia, serif;text-align:center;}
p {margin:0;}
#footer {background: #222; min-height: 200px; margin-top:500px; }
#footer div { border-bottom: 1px solid #d8ff72; min-height: 99px;}
.c1 {border:1px solid #000;}
* html #footer {height: 200px; } /*for IE6 */
* html #footer div { height: 99px;}  /*for IE6 */
</style>
 
 
</head>
<body>
 
 
<div id="footer">
<div><!-- --></div><!--/close #footer div -->
</div><!--/close #footer-->
 
 
</body>
</html>

David Laakso
David Laakso's picture
Offline
Enthusiast
US
Last seen: 12 years 4 weeks ago
US
Joined: 2008-07-18
Posts: 265
Points: 0

Note in the above CSS that

Note in the above CSS that this was not used nor is it needed:

.c1 {border:1px solid #000;}

maryjane9110024
maryjane9110024's picture
Offline
Regular
Phoenix, AZ
Last seen: 12 years 6 days ago
Phoenix, AZ
Timezone: GMT-7
Joined: 2007-12-27
Posts: 35
Points: 0

Next step...

How do I get the text on top of the line so that the line goes through it in the back?

David Laakso
David Laakso's picture
Offline
Enthusiast
US
Last seen: 12 years 4 weeks ago
US
Joined: 2008-07-18
Posts: 265
Points: 0

I give up: "What text on top

I give up: "What text on top of the line so that the line goes through it in the back?"

PS The "crystal ball" has the day off...

maryjane9110024
maryjane9110024's picture
Offline
Regular
Phoenix, AZ
Last seen: 12 years 6 days ago
Phoenix, AZ
Timezone: GMT-7
Joined: 2007-12-27
Posts: 35
Points: 0

ops

my bad... :blushing:

its a navigation; home, contact, etc

David Laakso
David Laakso's picture
Offline
Enthusiast
US
Last seen: 12 years 4 weeks ago
US
Joined: 2008-07-18
Posts: 265
Points: 0

That's nice. I am not a mind

That's nice. I am not a mind reader.

Half the battle in getting an answer to a question, lies in the art of knowing how to ask a question:

FWIW, text with a horizontal line running through it means delete in some circles..

1/ In addition to the navigation links "home," and "contact," what other navigation links are there?

2/ Are the navigation links to be set as a horizontal list, or as a vertical list?

3/ Is the horizontal list, or vertical list, to be set left, right, or centered in the parent container?

4/ Is the horizontal or vertical list to be above or below the green line.

5/ Is the horizontal or vertical list to be on top the green line.

6/ Is the horizontal or vertical list to be behind the green line.

7/ And so on...

maryjane9110024
maryjane9110024's picture
Offline
Regular
Phoenix, AZ
Last seen: 12 years 6 days ago
Phoenix, AZ
Timezone: GMT-7
Joined: 2007-12-27
Posts: 35
Points: 0

ok

ok. It's a horizontal navigation (home, contact us, services, about) with the background black and a green line horizontally through it like a strike through text but it stops say 20 px from the nav then picks up again on the other side. is that more clear? should i do a picture?

isedeasy
Offline
Enthusiast
Bristol
Last seen: 8 years 11 weeks ago
Bristol
Timezone: GMT+1
Joined: 2008-02-09
Posts: 74
Points: 12

Maybe this is more what you

Maybe this is more what you are after...

Footer Test

It does use a 1px by 1px image () but the mark-up is not at all bloated an semantically correct...

the lines can be removed between the links by adding negative margins to the links...

"If a man is trying to hang himself from the tree in my yard but the knot keeps slipping and allowing him to fall before it kills him do you expect someone to go out and teach him to tie a better knot?" - Triumph

David Laakso
David Laakso's picture
Offline
Enthusiast
US
Last seen: 12 years 4 weeks ago
US
Joined: 2008-07-18
Posts: 265
Points: 0

"A picture is worth a

"A picture is worth a thousand words."

I'm astounded by people who want to 'know' the universe when it's hard enough to find your way around Chinatown.

-- Woody Allen

David Laakso
David Laakso's picture
Offline
Enthusiast
US
Last seen: 12 years 4 weeks ago
US
Joined: 2008-07-18
Posts: 265
Points: 0

But don't let me or Woody

But don't let me or Woody fool you. We both know exactly what you want-- with or without your picture.

The likelihood of achieving your goal with CSS cross-browser is slim to none (at the moment). Holding a horizontal line midway through a horizontal list is a pipe dream. There are too many variables. User discretion to scale fonts, screen resolution, and dpi setting are among them. Granted it is a clever (cute) idea. Providing as previously mentioned that in some circles it will taken literally (as the horizontal menu has been deleted).

Nevertheless, and either way, it is possible to create such an illusion. The answer is, as it always is when trying to make the Web something other than what it is-- namely, do the whole footer, the text, the line through the text, and the colors as a photoshop image.

maryjane9110024
maryjane9110024's picture
Offline
Regular
Phoenix, AZ
Last seen: 12 years 6 days ago
Phoenix, AZ
Timezone: GMT-7
Joined: 2007-12-27
Posts: 35
Points: 0

isedeasy wrote:Maybe this is

isedeasy wrote:

Maybe this is more what you are after...

Footer Test

It does use a 1px by 1px image () but the mark-up is not at all bloated an semantically correct...

the lines can be removed between the links by adding negative margins to the links...

Yes that's it!

THANK YOU BOTH!!!!

maryjane9110024
maryjane9110024's picture
Offline
Regular
Phoenix, AZ
Last seen: 12 years 6 days ago
Phoenix, AZ
Timezone: GMT-7
Joined: 2007-12-27
Posts: 35
Points: 0

Code (future reference)

  <style type="text/css">
  <!--
 
    body {
    padding:0;
    margin:0;
    font-size:100%;
    font-family:Verdana, Arial, Helvetica, sans-serif;
    }
 
    #footer {
    font-size:80%;
    margin:500px 0 0 0;
    padding:40px 0;
    background:#000;
    }
 
    #footer ul {
    width:100%;
    padding:0;
    margin:0;
    list-style-type:none;
    background:#000 url(images/footer_line.png) repeat-x center left;
    color:#FFF;
    text-align:center;
    }
 
    #footer ul li {
    display: inline;
    }
 
    #footer ul li a {
    text-decoration: none;
    background:#000;
    color:#5ac000;
    padding:.2em 1em;
    }
 
    #footer ul li a:hover {
    background:#5ac000;
    color:#000;
    }
 
  //-->
  </style>
 
  </head>
  <body>
 
    <div id="footer">
 
      <ul>
 
        <li><a href="">Link 1</a></li>
        <li><a href="">Link 2</a></li>
        <li><a href="">Link 3</a></li>
        <li><a href="">Link 4</a></li>
        <li><a href="">Link 5</a></li>
        <li><a href="">Link 6</a></li>
 
      </ul>
 
    </div>
 
  </body>
</html>