Stop hyperlink inheriting div's width?
问题 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: 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