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 8079327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:04:06+00:00 2026-06-05T16:04:06+00:00

In the end this is gonna be a simple responsive slider. problems being the

  • 0

In the end this is gonna be a simple responsive slider. problems being the li’s wont stack horizontally. How can i maintain li’s that are 100% width of the current window and ul’s that overflow scrolls horizontally and not vertically? Is it possible to dot his only in css?

HERES A LIVE SAMPLE JSFIDDLES

html

 <article id="viewport">
  <ul id="slideshow">
    <li class="slide">
      <section id="towing">
        <div class="caption">
          <header>
            <h1>towing service</h1>
          </header>
          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum et nisi quam, eget cursus augue. Sed id felis non urna tristique lacinia vel quis neque. Vivamus nisl nibh, lacinia sed egestas et, euismod mollis sem. Maecenas non orci erat, a tincidunt magna.</p>
        </div>
      </section>
    </li>
    <li class="slide">
      <section id="scraping">
        <div class="caption">
          <header>
            <h1>metal scraping service</h1>
          </header>
          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum et nisi quam, eget cursus augue. Sed id felis non urna tristique lacinia vel quis neque. Vivamus nisl nibh, lacinia sed egestas et, euismod mollis sem. Maecenas non orci erat, a tincidunt magna.</p>
        </div>
      </section>
    </li>
    <li class="slide">
      <section>
        <div class="caption">
          <header>
            <h1>trade-in service</h1>
          </header>
          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum et nisi quam, eget cursus augue. Sed id felis non urna tristique lacinia vel quis neque. Vivamus nisl nibh, lacinia sed egestas et, euismod mollis sem. Maecenas non orci erat, a tincidunt magna.</p>
        </div>
      </section>
    </li>
  </ul>
</article>

CSS (.less symantics sorry)

    div#service{
    position:relative;
    height:800px;
    width: 100%;
    background:pink;}

article#viewport{
    position:relative;
    height:600px;
    width:100%;
    top:100px;
    background:@yellow;
    overflow:hidden; }
ul#slideshow{
    position:relative;
    overflow:auto;
    height:100%;
    display:inline-block; }

li.slide{
    position:relative;
    height:600px;
    width: 100%;
    zoom: 1;
    display:inline-block;
    background:#ccc;
}
div.caption{width:300px; background:#555;text-align:right;float:right;}

​

Ps. Why is it when I set the .captions to position absolute; it breaks this whole interaction?

  • 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-05T16:04:07+00:00Added an answer on June 5, 2026 at 4:04 pm

    Here’s the thing about your “slideshow” – the ul will default to width: auto, which means it expands to the width of its parent (since it’s a block element). It will not expand its width with its content, like it will with its height.

    So, what you need is a viewport div – a div with width: 100% and overflow: auto. This will allow for scrolling, and hiding of extra slides. Then, you need a div that has width of (x * 100)%, where x is the number of slides you have. This will allow for all the space you need for the slides, layed out horizontally.

    Also, your slides will need width equal to (100 / x)% (round down), where x, again, is the number of slides you have. This seems counter-intuitive, but if you think about it, they will become 1 xth of the size of x times 100% of the window – which means they’ll be 100% the size of the window.

    Lastly, you’ll need to use float: left; instead of display: inline-block. I’m not sure exactly why this is, but it’s the only way I could get it to work. Which is okay by me because I kinda hate inline-block.

    Here’s a working Fiddle

    I don’t believe there’s a way to do this with pure CSS and without prior knowledge of how many slides there are.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background WCF Stack, Data Access Implemented in Entity Framework, Simple ASP.NET Front End This
I'm at my wit's end with this. Can anyone see anything wrong with this
Can anyone tell me why the form at the end of this question isn't
In PHP I can do this: print <<<END This uses the here document syntax
class MyTestController < ApplicationController def index render_text hello world end end This is what
class Followup < ActiveRecord::Base belongs_to :post belongs_to :comment end This model needs to only
Solution at end of this post. By default the time is set to one
I read this article Managing Hierarchical Data in MySQL At the end of this
I'm beginning to get to my wit's end on this one. I have Jenkins
I have a create method in one controller and at the end of this

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.