Forum
ยป
HTML gurus please help me
- Results 1 to 8 of 8
-
Page 1 of 1
Thread: HTML gurus please help me
10-11-2020, 05:03 AM
-
#1
- darkeminence
- Registered User
-
- darkeminence
- Registered User
- Join Date: May 2007
- Age: 37
- Posts: 2,760
- Rep Power: 2174
-
-
HTML gurus please help me
I'm trying to make a very simple website (still learning HTML) but stuck with the following.
How do I get the image not to overshoot the main area and overlap the footer and space beneath the website? So the image just needs to "create" white space in the main area, so it would fit perfectly.
Thanks brehs

How do I get the image not to overshoot the main area and overlap the footer and space beneath the website? So the image just needs to "create" white space in the main area, so it would fit perfectly.
Thanks brehs

10-11-2020, 05:04 AM
-
#2
10-11-2020, 05:11 AM
-
#3
- darkeminence
- Registered User
-
- darkeminence
- Registered User
- Join Date: May 2007
- Age: 37
- Posts: 2,760
- Rep Power: 2174
-
-
Originally Posted By EndofDaze⏩
The images already have float elements. I'm just use <main> for the whole area between the footer and the top of the page. Do I need to put the image in a div or something?Use float element so div doesn't overlap
10-11-2020, 05:12 AM
-
#4
- notoriousthug
- Son of Zyzz
-
- notoriousthug
- Son of Zyzz
- Join Date: Nov 2015
- Posts: 752
- Rep Power: 2392
-
-
put the image in a div/container, set the container size, then set the image to occupy 100% of the container.
hope that works. haven't touched html in a few weeks.
hope that works. haven't touched html in a few weeks.
10-11-2020, 05:17 AM
-
#5
- darkeminence
- Registered User
-
- darkeminence
- Registered User
- Join Date: May 2007
- Age: 37
- Posts: 2,760
- Rep Power: 2174
-
-
Originally Posted By notoriousthug⏩
What is the code for that?put the image in a div/container, set the container size, then set the image to occupy 100% of the container.
hope that works. haven't touched html in a few weeks.
hope that works. haven't touched html in a few weeks.
10-11-2020, 05:29 AM
-
#6
- notoriousthug
- Son of Zyzz
-
- notoriousthug
- Son of Zyzz
- Join Date: Nov 2015
- Posts: 752
- Rep Power: 2392
-
-
Originally Posted By darkeminence⏩
divWhat is the code for that?
{
width:100%;
height:100px;
}
img
{
width:100%;
}
something like that. play around with the units till you get what works for your webpage. if that doesn't work you can post your code on codepen and we'll have a look.
10-11-2020, 06:13 AM
-
#7
- fattony7891
- ROCKET SHIP IN MY PANTS
-
- fattony7891
- ROCKET SHIP IN MY PANTS
- Join Date: Jul 2007
- Posts: 686
- Rep Power: 315
-
-
Why not use flex box?
It gives you the best parts of floats but without the weird quirks and "hacks" that you sometimes need to make it display correctly.
Create a container for the two divs ([put the image in a div prob makes it easiest), give the container display: flex and maybe flex-wrap: wrap.
Then give the two inside divs flex: 1 1 50%. Or change the % to whatever you want. If you want margins between the divs then just add the css for that and drop the %s so that they two divs still sit side by side.
Flex box makes things scale nicely on different screen sizes as well. (No idea if floats do that correctly, as I have never used them)
It gives you the best parts of floats but without the weird quirks and "hacks" that you sometimes need to make it display correctly.
Create a container for the two divs ([put the image in a div prob makes it easiest), give the container display: flex and maybe flex-wrap: wrap.
Then give the two inside divs flex: 1 1 50%. Or change the % to whatever you want. If you want margins between the divs then just add the css for that and drop the %s so that they two divs still sit side by side.
Flex box makes things scale nicely on different screen sizes as well. (No idea if floats do that correctly, as I have never used them)
Be Extraordinary.
10-11-2020, 06:23 AM
-
#8
You could also clearfix the parent element so it clears the child elements.
Without seeing the code that'd be my best suggestion.
Without seeing the code that'd be my best suggestion.
Smooth Seas don't make Strong Sailors. Keep your head up.
MrWhiskey24 for jolly cooperation (PS)
Bookmarks
-
- Digg
-
- del.icio.us
-

- StumbleUpon
-
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts