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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:08:18+00:00 2026-05-26T22:08:18+00:00

I am trying to create css to solve a problem with displaying a like

  • 0

I am trying to create css to solve a problem with displaying a like button next to a page title. I have 3 cases.

  • The title fits to the left of the like button
  • The title is long and flows to multiple lines to the left of the button
  • The title has long words that overflow the div and cover the like button

Cases

My question: Is there a way to set up the div so when case 3 happens, the div grows and pushes the like button below the title but keeps the same functionality for cases 1 and 2?

  • 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-05-26T22:08:18+00:00Added an answer on May 26, 2026 at 10:08 pm

    Dynamically remove the width when the word causes overflow. By removing width, you cause the button to move down and thus behave like options 1&2.

    Check these divs dynamically with some jQuery/JavaScript to see if a word causes an overflow.

    //Javascript function to remove width class when overflow occurs.
    //40em is an arbitrary width
        $.each($('.ConstrainedDiv'),function() {
            var wordregex = /\w+/g;
            var content = $(this).html();
            var wordArray = content.match(wordregex );
            for(var i = 0; i < wordArray.length; i++) {
                if(wordArray[i].length > 40) {
                    $(this).removeClass('someWidth');//behavior changes if you remove this
                    break;
                }
            }
        });
    

    Fiddle. Note the difference in behavior by commenting out the marked line. Note2 resolution and fiddle box width matter.[Demo tested in FF7]

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

Sidebar

Related Questions

I am trying to create a CSS layout where the page looks like it's
I am trying to create a CSS theme switcher button like below. The top
I am trying to create a css menu. I would like to remove border
I'm trying to create a particular CSS button described here: http://www.2shared.com/file/5131551/412bd8a8/Sans_titre-1_copie.html Basically, it's a
I have the following HTML: <DIV class=foo bar></DIV> I'm trying to create a CSS
I have a problem when I create page with the script showing document.write(Text); text
I'm trying to create a run time css-based swf which DOES NOT have embedded
I am trying to create a button using CSS Gradients plus a icon that
I'm trying to create a pure css Venn diagram like this Where the circle
I'm trying to create css buttons by using the following html markup: <a href=access.php

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.