Home Entrance Everyone Wiki Search Login Register

Welcome, Guest. Please login or register. - Thinking of joining the forum??
April 20, 2024 - @0.06 (what is this?)
Forum activity rating: Three Star Posts: 47/1k.beats Unread Topics | Unread Replies | Own Posts | Own Topics | Random Topic | Recent Posts
News: :4u: ~~~~~~~~~~~  :4u:

+  MelonLand Forum
|-+  World Wild Web
| |-+  ✁ ∙ Web Crafting
| | |-+  ☔︎ ∙ I need Help!
| | | |-+  Best way to have a 2 column site?


« previous next »
Pages: [1] Print
Author Topic: Best way to have a 2 column site?  (Read 1917 times)
Obspogon
Jr. Member ⚓︎
**


Hi

SpaceHey: Friend Me!
StatusCafe: obspogon
iMood: Obspogon
Matrix: Chat!
XMPP: Chat!

View Profile WWW

First 1000 Members!OG! Joined 2021!
« on: November 21, 2021 @798.13 »

I want to have a homepage with 2 columns of unequal width but the same height.
Logged

----------------------
https://obspogon.neocities.org/
----------------------

Melooon
Hero Member ⚓︎
*****


So many stars!

SpaceHey: Friend Me!
StatusCafe: melon
iMood: Melonking
Itch.io: My Games

View Profile WWW

First 1000 Members!spring 2023!Squirtle!!!!MIDI WarriorMIDI Warrior1234 Posts!OzspeckCool Dude AwardRising Star of the Web AwardMessage BuddyPocket Icelogist!OG! Joined 2021!The Smallest Ozwomp Known To ManBug!
« Reply #1 on: November 21, 2021 @813.16 »

The new school way would be to use flex, although that's designed for sites that have dynamic width.
Which you can read about here: https://css-tricks.com/snippets/css/a-guide-to-flexbox/

If you wanna do it the old way you can make both columns float left, then set a fixed width for each (you can also do a % width for dynamic sizing)

Something like: Untested sample code to give an idea, may not directly work! This will create 2 columns that should always be 100% the height of the wrapper, so in theory as the wrapper expands, so will both columns.

Code

<div id="wrapper">
 <div id="col-a"></div>
 <div id="col-b"></div>
</div>

#wrapper {
 width: 700px;
 margin: 0px auto 0px auto;
}

#col-a, #col-b {
 float: left;
 height: 100%;
}

#col-a {
 width: 200px;
}

#col-b {
 width: 500px;
}

Logged


everything lost will be recovered, when you drift into the arms of the undiscovered
Obspogon
Jr. Member ⚓︎
**


Hi

SpaceHey: Friend Me!
StatusCafe: obspogon
iMood: Obspogon
Matrix: Chat!
XMPP: Chat!

View Profile WWW

First 1000 Members!OG! Joined 2021!
« Reply #2 on: November 21, 2021 @967.45 »

Used the flex method and it works now. Thanks.
Logged

----------------------
https://obspogon.neocities.org/
----------------------

fLaMEd
Casual Poster ⚓︎
*


View Profile WWW

First 1000 Members!OG! Joined 2021!
« Reply #3 on: February 13, 2023 @208.53 »

If you wanna do it the old way you can make both columns float left, then set a fixed width for each (you can also do a % width for dynamic sizing)

Scream/Lol, why would you want to do it the old way haha! 

Like going for a run with a weight vest :joy:
Logged
Pages: [1] Print 
« previous next »
 

Vaguely similar topics! (3)

How do you prefer to keep your site organized (or not)

Started by NightdriftBoard ✁ ∙ Web Crafting

Replies: 26
Views: 5754
Last post January 26, 2024 @915.29
by Paprika
POLL: How many personal sites have you built?

Started by xandraBoard ✁ ∙ Web Crafting

Replies: 30
Views: 4341
Last post January 11, 2024 @150.49
by xXWebMasterXx_Gina
I am new to making sites and I want some tips to improve.

Started by Icey!Board ☔︎ ∙ I need Help!

Replies: 4
Views: 1750
Last post December 14, 2021 @853.48
by Icey!

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021, Simple Machines | Terms and Policies Forum Guide | Rules | RSS | WAP2


MelonLand Badges and Other Melon Sites!

MelonLand Project! Visit the MelonLand Forum! Support the Forum
Visit Melonking.Net! Visit the Gif Gallery! Pixel Sea TamaNOTchi