Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

content-dependant sidebar

Featured Replies

I'm trying to create a fluid 2-column layout where the width of the sidebar depends on an image that it contains. Actually, I can make the sidebar okay - and even make the underlying menu items fill it. However, I'm having problems with the other column - the main content.

 

I want, going across the screen from left to right: border, sidebar, gutter, main content, border.

The width of the borders and the gutter might be, say, 2%. The width of the sidebar depends on an image it contains and the main content takes up the rest of the space.

 

With the main content, I can:

1) position of its left edge dependant on the width of the sidebar and the right edge dependant on the width of the main content;

2) fix the position of the left edge and put the right edge by the border

 

What I want to do, but can't, is pin the left edge to the gutter and the right edge to the border.

 

The icing on the cake would be equal length columns but I can live without that.

Edited by altis

You can change the float of your main part to the left and then ad 2% margin from the left. That will give you the 2% gutter :)

 

Cheers B)

Thanks, but that looks even worse:

 

http://altis.org.uk/120529/

 

I think it is a better idea too put a div around your whole code and then give that a width of 100%;

Then you can give main 80% or something and the other div 16%, then you still have the 2% gutter...

 

Because things get ugly when they get bigger! I got a 1920x1080 resolution, but the site then huge from size!

Maybe it is something to think about ;)

 

Cheers B)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.