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

  • Home
  • SEARCH
  • 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 3439240
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:17:07+00:00 2026-05-18T08:17:07+00:00

Hi I have some hyperlinks inside a div with display:block. Problem is that the

  • 0

Hi I have some hyperlinks inside a div with display:block. Problem is that the hyperlinks length when clicked is equal to the div’s width. How do I make the hyperlink’s clicked length equal to the text of the hyperlink only without specifying width for each link ?
JSFiddle 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-05-18T08:17:08+00:00Added an answer on May 18, 2026 at 8:17 am

    Use

    #links a {clear:left;float:left}

    The float will allow the link to be sized, and the clear will prevent the links from being on the same line.

    You may need to add a clear:left to the #links container depending on your design.

    EDIT

    A little tutorial since you asked:

    There are two types of elements, inline and block. Inline ones show in a line with no breaks. Block elements take up the whole line and move to the next one.

    Inline elements can’t have their width or height styled. Blocks can.

    <a> is an inline element. By setting its display to block, you tell it to make a new line every time.

    float gives elements inline behavior so they bump up next to eachother and flow over onto the next line. float also allows you to style the width/height of the element. It’s sort of a mix between the two.

    The clear attribute stops the inline floating and goes back to normal block behavior (new lines every time).

    You won’t need display:block and float: at the same time.

    Another solution would involve display:inline-block, but this is not supported in several browsers so isn’t encouraged (although I find it pretty handy).

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

Sidebar

Related Questions

My problem.. I have a number of images (inside hyperlinks), and I want each
I'm pretty new to silverlight. I have a text block that is displayed inside
I've got a div called 'menu' and inside that menu there are some divs
I have an HTML web page (the parent) that contains a hyperlink. When clicked,
I have a little problem, I just made a menu with some asp:hyperlink structured
I have some UI in VB 2005 that looks great in XP Style, but
We have some input data that sometimes appears with &nbsp characters on the end.
We have some files on our website that users of our software can download.
I have a MVC application that reads some data from a database and loads
I have written an ASP.NET MVC application that runs inside an IFrame. When 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.