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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T13:08:16+00:00 2026-06-18T13:08:16+00:00

I have divs after each other that look like this. <div class=tag>one tag</div> <div

  • 0

I have divs after each other that look like this.

<div class="tag">one tag</div>
<div class="tag">second tag</div>
<div class="tag">third tag</div>
...50 more of them....


(in CSS)

.tag {
    display:inline
}

I found out that I have too many of them and they start breaking in the middle, and I don’t want that.

However, when I set the nowrap like this

.tag {
    display:inline;
    white-space:nowrap;
}

all of them are on one line, making more than 100% of the window. I don’t want that.

What I want: if there are too many of these divs on one line, the list of the divs can break, but the divs themselves don’t. I just don’t want to break the divs in the middle.

I hope I tell it clearly enough.

  • 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-18T13:08:17+00:00Added an answer on June 18, 2026 at 1:08 pm

    If I understand right, you want them to lay side to side, and then break to a new line when the row is full, but not in the middle of a div.

    All you need is

    .tag {
        float: left;
    }
    

    See fiddle here for demo.

    You can also add padding-left: 5px; if you want some space between them.

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

Sidebar

Related Questions

I have 4 hard coded divs. After the third div I would like to
What I want is to have mutliple divs after one another, that each is
I keep finding that if I have nested divs inside each other, and one
I have a series of <div class=clear-both></div> after a series of divs. I want
I have several divs that are generated dynamically after a file is uploaded. Each
I have HTML like this: <div id=Div1>...</div> <div class=someClass>...</div> <div id=Div2>...</div> <div class=someClass>...</div> <div
I have a page ItemList that shows a list of items using div's. After
I have three divs, within a content div. Container width 70%. Within that I
I have two divs floated next to one another: <div id=parent> <div id=child_1 style=float:left>
I'm appending some buttons from an XML-file, into some divs. Each div has one

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.