Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8671491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:57:48+00:00 2026-06-12T18:57:48+00:00

I work for a creative design studio who likes to break paradigms and convention

  • 0

I work for a creative design studio who likes to break paradigms and convention to create unique website layouts and recently we’ve started developing horizontal website layouts. While horizontal website layouts look “cool” I’ve yet to work out how to make them fluid and responsive like you can with a vertical grid based website out-of-the-box.

Normally for a vertical website with a container you’d have a percentage based width on your container element, then set a max-width. With a responsive layout your content infinitely scrolls off of the page, it can vary in width especially if the content is unique and therefore the formula target/context * 100 doesn’t really work (or does it?).

Is there perhaps a way to have responsive heights, padding and margins on elements to make it work just like you would a grid based responsive website. I don’t mind having to use Javascript but a CSS fix would be ideal.

For your reference an example of the type of layout I am trying to create:

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T18:57:49+00:00Added an answer on June 12, 2026 at 6:57 pm

    You can do this with jQuery by calculating the page container div’s child elements .outerWidth and adding them all together and appending that to the page or div’s .css('width')

    HTML structure:

    <div id="main">
        <div><img src="#" /></div>
        <div><img src="#" /></div>
        <div><img src="#" /></div>
    </div>
    

    EDIT: I forgot to add the css, but the main point here is you would want the child divs of #main to be floating left.

    Javascript:

    function() {
            var window_width = jQuery(window).width(),
                container = jQuery('#main'),
                page_width = 0;
    
            // Grab every child element of the "main" container
            container.children().each(function(index){
                var incl_margin = true,
                    $this = jQuery(this);
    
                // Check if each child element has a margin-left or margin-right
                if ( parseInt($this.css('margin-left')) < 0 || parseInt($this.css('margin-right')) < 0 ) {
                    var incl_margin = false;
                }
    
                // Get element's width including margins (if they exist from above)
                var width = $this.outerWidth(incl_margin);
                page_width += width;
    
            });
    
            // Add total width of containers elements as the containers width
            if(page_width > 0)
                container.css({'width' : page_width + 'px'});
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Work on the following website: http://cetcolor.com The masthead graphic with the Read About It
Work on ASP.NET Visual Studio 2008 C#. I have a page. From this page
Work on C# Desktop project,I have an account on paypal ,From my desktop application
work on asp.net vs 05 C#.Master page header contain the bellow code <script type=text/javascript
work on SQL Server 2000. want to Automated Email Notifications using SQL Server Job
Work on asp.net vs05. I have three type of value Like:IsDesign,IsPrinting,IsInstall they are bit
Work on a support helpdesk. New tickets come in and records are created in
Work on this small test application to learn threading/locking. I have the following code,
I work with unordered_set . Here it's written that it has a reserve function
At work our end-users are on Windows XP and using Outlook Express. Whenever a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.