Hi,
I have four images lined p on a single row. The HTML code is:
<div id="header">
<div class="header_image">
<img id="home_logo" src="images/home_logo.gif" alt="" />
</div>
<div class="header_image">
<img id="acc_spinning_logo" src="images/acc_spinning_logo.gif"
alt="" />
</div>
<div class="header_image">
<img id="acc_logo_end" src="images/acc_logo_end.gif" alt="" />
</div>
<div class="header_image" id="header_image_4">
<img id="title_bar_right" src="images/title_bar_right.gif"
alt="" />
</div>
</div>
In my CSS file, I use float:left to ensure they appear on the same
row. My question is, while I want the first three images to appear at
the width they are, I'd like the forth to stretch the rest of the
screen regardless of the screen width. Can this be done sing CSS?
Thanks,
Don 11 1851
<do*@fivestarterminals.comwrote in message
news:2e**********************************@m45g2000 hsb.googlegroups.com...
Hi,
I have four images lined p on a single row. The HTML code is:
<div id="header">
<div class="header_image">
<img id="home_logo" src="images/home_logo.gif" alt="" />
</div>
<div class="header_image">
<img id="acc_spinning_logo" src="images/acc_spinning_logo.gif"
alt="" />
</div>
<div class="header_image">
<img id="acc_logo_end" src="images/acc_logo_end.gif" alt="" />
</div>
<div class="header_image" id="header_image_4">
<img id="title_bar_right" src="images/title_bar_right.gif"
alt="" />
</div>
</div>
In my CSS file, I use float:left to ensure they appear on the same
row. My question is, while I want the first three images to appear at
the width they are, I'd like the forth to stretch the rest of the
screen regardless of the screen width. Can this be done sing CSS?
Firstly your HTML is too verbose. Secondly if it really is a header it
should be marked up as one (in the example below I assume it's the main page
header, so h1). Thirdly you don't need float: left to make them on the same
row if you don't wrap the images in an extra div because images are inline
by default. Fourthly if the image of the logo contains any text, then that
text should be in the alt attribute. Lastly you can get the image to fill
the width by making it a background image, which will repeat automatically.
Something like this should do it:
<style type="text/css">
h1 {
background: url( title_bar_right.gif ) repeat-x;
}
</style>
<h1><img src="images/home_logo.gif" alt="logo" /><img
src="images/acc_spinning_logo.gif" alt="spinning logo" /><img
src="images/acc_logo_end.gif" alt="logo end" /></h1>
In article
<2e**********************************@m45g2000hsb. googlegroups.com>,
"do*@fivestarterminals.com" <do*@fivestarterminals.comwrote:
Hi,
I have four images lined p on a single row. The HTML code is:
<div id="header">
<div class="header_image">
....
>
In my CSS file, I use float:left to ensure they appear on the same
row. My question is, while I want the first three images to appear at
the width they are, I'd like the forth to stretch the rest of the
screen regardless of the screen width. Can this be done sing CSS?
<http://dorayme.890m.com/alt/three_and_stretch.html>
--
dorayme
Thanks but It doesn't work completely.
1) I'm getting gaps between the 3 images.
2) The background image is not displayed.
Here is the HTML code:
----------------------------------
<div id="header_logo">
<img src="images/home_logo.gif" alt="logo" />
<img src="images/acc_spinning_logo.gif" alt="spinning logo" />
<img src="images/acc_logo_end.gif" alt="logo end" />
</div>
Here is the CSS code
-------------------------------
#header_logo {
margin: 0;
padding: 0;
background-image: url(../images/title_bar_right.gif )
background-repeat: repeat-x;
}
Thanks,
Don
<do*@fivestarterminals.comwrote in message
news:f1**********************************@l42g2000 hsc.googlegroups.com...
Thanks but It doesn't work completely.
1) I'm getting gaps between the 3 images.
2) The background image is not displayed.
Here is the HTML code:
----------------------------------
<div id="header_logo">
<img src="images/home_logo.gif" alt="logo" />
<img src="images/acc_spinning_logo.gif" alt="spinning logo" />
<img src="images/acc_logo_end.gif" alt="logo end" />
</div>
Here is the CSS code
-------------------------------
#header_logo {
margin: 0;
padding: 0;
background-image: url(../images/title_bar_right.gif )
background-repeat: repeat-x;
}
Thanks,
Don
That's because the images are on new lines, so there is white space between
them. What you are seeing is the white space in your markup. If you run
them together like <img src="..." alt="..."><img src="..." alt="..."><img
src="..." alt="..."it goes away.
Either float them left or remove the white space. Here's an example with
floats: http://nrkn.com/temp/don/
On May 25, 9:07 pm, "Nik Coughlin" <nrkn....@gmail.comwrote:
<d...@fivestarterminals.comwrote in message
news:f1**********************************@l42g2000 hsc.googlegroups.com...
Thanks but It doesn't work completely.
1) I'm getting gaps between the 3 images.
2) The background image is not displayed.
Here is the HTML code:
----------------------------------
<div id="header_logo">
<img src="images/home_logo.gif" alt="logo" />
<img src="images/acc_spinning_logo.gif" alt="spinning logo" />
<img src="images/acc_logo_end.gif" alt="logo end" />
</div>
Here is the CSS code
-------------------------------
#header_logo {
margin: 0;
padding: 0;
background-image: url(../images/title_bar_right.gif )
background-repeat: repeat-x;
}
Thanks,
Don
That's because the images are on new lines, so there is white space between
them. What you are seeing is the white space in your markup. If you run
them together like <img src="..." alt="..."><img src="..." alt="..."><img
src="..." alt="..."it goes away.
Either float them left or remove the white space. Here's an example with
floats:
http://nrkn.com/temp/don/
On May 25, 9:07 pm, "Nik Coughlin" <nrkn....@gmail.comwrote:
<d...@fivestarterminals.comwrote in message
news:f1**********************************@l42g2000 hsc.googlegroups.com...
Thanks but It doesn't work completely.
1) I'm getting gaps between the 3 images.
2) The background image is not displayed.
Here is the HTML code:
----------------------------------
<div id="header_logo">
<img src="images/home_logo.gif" alt="logo" />
<img src="images/acc_spinning_logo.gif" alt="spinning logo" />
<img src="images/acc_logo_end.gif" alt="logo end" />
</div>
Here is the CSS code
-------------------------------
#header_logo {
margin: 0;
padding: 0;
background-image: url(../images/title_bar_right.gif )
background-repeat: repeat-x;
}
Thanks,
Don
That's because the images are on new lines, so there is white space between
them. What you are seeing is the white space in your markup. If you run
them together like <img src="..." alt="..."><img src="..." alt="..."><img
src="..." alt="..."it goes away.
Either float them left or remove the white space. Here's an example with
floats:
http://nrkn.com/temp/don/
That worked, thanks. However, I cannot get the background image to
display. Are there any tools for debugging this?
<do*@fivestarterminals.comwrote in message
news:05**********************************@t54g2000 hsg.googlegroups.com...
On May 25, 9:07 pm, "Nik Coughlin" <nrkn....@gmail.comwrote:
><d...@fivestarterminals.comwrote in message news:f1**********************************@l42g200 0hsc.googlegroups.com...
Thanks but It doesn't work completely.
1) I'm getting gaps between the 3 images.
2) The background image is not displayed.
Thanks,
Don
That's because the images are on new lines, so there is white space between them. What you are seeing is the white space in your markup. If you run them together like <img src="..." alt="..."><img src="..." alt="..."><img src="..." alt="..."it goes away.
Either float them left or remove the white space. Here's an example with floats:
http://nrkn.com/temp/don/
That worked, thanks. However, I cannot get the background image to
display. Are there any tools for debugging this?
Could be your path. Another thing to check is the case of the file names,
but it looks like your image names are all in lower case so it's probably
not that. Image paths in CSS should be relative to your image. Looks like
you are doing this:
<img src="images/home_logo.gif" alt="logo" />
....
background-image: url(../images/title_bar_right.gif )
So I assume from the about that your CSS is in a seperate folder off the
root in which case the above is correct.
Is the parent div expanding to the width of its parent element? You can
test this by giving it border: 1px solid red so that you can see its
boundaries. If you're floating it then it won't be expanding to width:
auto, it will shrink to contain its contents.
Or you could upload what you have to some temporary web space (plenty of
free ones around if you don't have something), try and make it a minimal
test case just showing your problem and we'll go from there.
It's a "float" problem. If I comment out the "float: left;" below,
the background image shows. Uncommenting it and it does not show. By
the way, the border also screws up when I float the images; only the
top border shows.
Very strange.
HTML
--------
<div id="header">
<div id="header_logos">
<img id="home_logo" src="images/home_logo.gif" alt="logo" />
<img id="acc_spinning_logo" src="images/acc_spinning_logo.gif"
alt="spinning logo" />
<img id="acc_logo_end" src="images/acc_logo_end.gif" alt="logo
end" />
</div>
<div id="header_clear"></div>
</div>
CSS
-------
#header_logos {
border: 1px solid red;
margin: 0;
padding: 0;
background-image: url(../images/title_bar_right.gif);
background-position: top right;
background-repeat: no-repeat;
}
#header_logos img {
float: left;
}
#header_clear {
clear: left;
}
I changed the HTML to this (following your example page in your
previous post) and it works now
<div id="header">
<div id="header_logos">
<img id="home_logo" src="images/home_logo.gif" alt="logo" />
<img id="acc_spinning_logo" src="images/acc_spinning_logo.gif"
alt="spinning logo" />
<img id="acc_logo_end" src="images/acc_logo_end.gif" alt="logo
end" />
<div id="header_clear"></div>
</div>
</div>
Thanks,
Don
On 2008-05-25, dorayme <do************@optusnet.com.auwrote:
In article <2e**********************************@m45g2000hsb .googlegroups.com>,
"do*@fivestarterminals.com" <do*@fivestarterminals.comwrote:
>Hi,
I have four images lined p on a single row. The HTML code is:
<div id="header"> <div class="header_image">
...
>> In my CSS file, I use float:left to ensure they appear on the same row. My question is, while I want the first three images to appear at the width they are, I'd like the forth to stretch the rest of the screen regardless of the screen width. Can this be done sing CSS? <http://dorayme.890m.com/alt/three_and_stretch.html>
Why not just http://www.tidraso.co.uk/misc/three_and_stretchB.html
In other words: float the images or the div they're in and set a left
margin on the fourth one.
Using position: relative with top: -45px assumes that font descent is
4px (the images are 41px high), but one doesn't know the font size. If
you bump up the font in your example, the right hand div moves down
relative to the imgs.
In article <sl*********************@bowser.marioworld>,
Ben C <sp******@spam.eggswrote:
On 2008-05-25, dorayme <do************@optusnet.com.auwrote:
In article
<2e**********************************@m45g2000hsb. googlegroups.com>,
"do*@fivestarterminals.com" <do*@fivestarterminals.comwrote:
Hi,
I have four images lined p on a single row. The HTML code is:
<div id="header">
<div class="header_image">
...
>
In my CSS file, I use float:left to ensure they appear on the same
row. My question is, while I want the first three images to appear at
the width they are, I'd like the forth to stretch the rest of the
screen regardless of the screen width. Can this be done sing CSS?
<http://dorayme.890m.com/alt/three_and_stretch.html>
Why not just
http://www.tidraso.co.uk/misc/three_and_stretchB.html
In other words: float the images or the div they're in and set a left
margin on the fourth one.
Using position: relative with top: -45px assumes that font descent is
4px (the images are 41px high), but one doesn't know the font size. If
you bump up the font in your example, the right hand div moves down
relative to the imgs.
I was just playing about and I have been meaning to take it down! How
can one take words and things back from history? It is not like a tape.
You are right. Much better. And the images can be spaced too with yours.
(one of the things I did not know was if the OP wanted gaps between his
images and I did not want to have the bg all the way underneath in case.
But my "solution" was no good really, for the reason you mention -
different browsers and font settings bring this out).
I just had a Salieri moment and was thinking how good old JK's sub/sup
idea was yesterday and relative positioning was in my mind, throwing me
off balance. I like simple but good ideas. He comes up with these things
for one reason and one reason only, to keep me unbalanced... I was very
badly shaken by it. God is against me. <g>
--
dorayme This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Derek Fountain |
last post by:
I have an image which I want to tile in a table cell. The table cell should
expand to fill "the rest of the width" available. This works in Mozilla:
<td width="100%"...
|
by: Greg Heilers |
last post by:
Hello everyone...
If one has a <div> that is completely filled with a
background-image; how does one style it so that the
image *continues* to fill the <div> top-to-bottom,
left-to-right; if...
|
by: Anand Ganesh |
last post by:
HI All,
I have an Image. I want to clip a portion of it and copy to another image.
How to do this? I know the bounding rectangle to clip.
Any suggestions please.
Thanks for your time and...
|
by: tshad |
last post by:
I am trying to set up an Image authorization where you type in the value
that is in a picture to log on to our site.
I found a program that is supposed to do it, but it doesn't seem to work.
...
|
by: aparth |
last post by:
I've been trying and failing to create an image map that contains a tiled background image underneath the main image.
My image map is 600px in height. I want the main image (img_bottom.jpg) to...
|
by: browntown |
last post by:
so I have this application I'm nearly finished with. The only thing the
client has requested is the ability to submit the form by pressing
"enter". I didn't think this would be a huge pain in the...
|
by: rsteph |
last post by:
I've got some product information pages, with images and text, all setup within a table. I'm trying to add a small image in the upper right hand corner of the content div (where all the important...
|
by: Elias Alhanatis |
last post by:
Hello everybody!!
I would like some help with the following problem:
I have the following piece of code:
from Tkinter import *
root = Tk()
|
by: skanemupp |
last post by:
why is the first program not working? when i click the screen the map
is not appearing.
the second program works.
from Tkinter import *
master = Tk()
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
|
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...
| |