Log In

Your email is not your username

Register

If you were a member of the old Bodybuilding.com forums and would like to reuse your previous username, you can request it below. We use your email only for registration and do not store it. For more information, please see our Privacy Policy.

Confirm your email

A registration code was sent to your email. Enter it here.

Welcome

You have successfully setup your account.

Sign in

Quick Navigation Bottom Misc
Forum
ยป HTML gurus please help me
  1. Results 1 to 8 of 8
post 1619038081 10-11-2020, 05:03 AM
-
#1
  1. darkeminence
  2. Registered User
  1. darkeminence
  2. Registered User
  3. Join Date: May 2007
  4. Age: 37
  5. Posts: 2,760
  6. 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

post 1619038111 10-11-2020, 05:04 AM
-
#2
  1. Odjur
  2. Registered User
  1. Odjur
  2. Registered User
  3. Join Date: Jan 2020
  4. Age: 56
  5. Posts: 134
  6. Rep Power: 0
have you tried turning it on and off again?
post 1619038221 10-11-2020, 05:11 AM
-
#3
  1. darkeminence
  2. Registered User
  1. darkeminence
  2. Registered User
  3. Join Date: May 2007
  4. Age: 37
  5. Posts: 2,760
  6. Rep Power: 2174
Originally Posted By EndofDaze
Use float element so div doesn't overlap
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?
post 1619038231 10-11-2020, 05:12 AM
-
#4
  1. notoriousthug
  2. Son of Zyzz
  1. notoriousthug
  2. Son of Zyzz
  3. Join Date: Nov 2015
  4. Posts: 752
  5. 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.
post 1619038341 10-11-2020, 05:17 AM
-
#5
  1. darkeminence
  2. Registered User
  1. darkeminence
  2. Registered User
  3. Join Date: May 2007
  4. Age: 37
  5. Posts: 2,760
  6. Rep Power: 2174
Originally Posted By notoriousthug
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.
What is the code for that?
post 1619038511 10-11-2020, 05:29 AM
-
#6
  1. notoriousthug
  2. Son of Zyzz
  1. notoriousthug
  2. Son of Zyzz
  3. Join Date: Nov 2015
  4. Posts: 752
  5. Rep Power: 2392
Originally Posted By darkeminence
What is the code for that?
div
{
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.
post 1619039601 10-11-2020, 06:13 AM
-
#7
  1. fattony7891
  2. ROCKET SHIP IN MY PANTS
  1. fattony7891
  2. ROCKET SHIP IN MY PANTS
  3. Join Date: Jul 2007
  4. Posts: 686
  5. 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)
Be Extraordinary.
post 1619039981 10-11-2020, 06:23 AM
-
#8
  1. MrBourbon
  2. Some idiot
  1. MrBourbon
  2. Some idiot
  3. Join Date: Aug 2014
  4. Posts: 29,843
  5. Rep Power: 577365
You could also clearfix the parent element so it clears the child elements.

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)
Quick Navigation Top Misc
Bookmarks
Digg.com
Digg
del.icio.us
del.icio.us
Stumbleupon.com
StumbleUpon
Google.com
Google
Facebook.com
Facebook
Posting Permissions
  1. You may not post new threads
  2. You may not post replies
  3. You may not post attachments
  4. You may not edit your posts