/    Sign up×
Community /Pin to ProfileBookmark

<br> in an anchor link?

Is there anything wrong with having something like this: <a href=”#”>text<br>text</a> or any number of <br>’s for that matter? Is there a better way to break up a link’s text?

to post a comment
HTML

12 Comments(s)

Copy linkTweet thisAlerts:
@fredmvFeb 12.2004 — You cannot do that due to the fact that inline-level elements cannot contain block-level elements. Perhaps if you explain how you want this to work we can come up with a more efficent solution.
Copy linkTweet thisAlerts:
@thejoker101authorFeb 12.2004 — I have some link text that are too long and instead of shrinking down the text-size, I'd like to break it into two lines.
Copy linkTweet thisAlerts:
@fredmvFeb 12.2004 — &lt;style type="text/css"&gt;
/*&lt;![CDATA[*/
a span {
display: block;
}
/*]]&gt;*/
&lt;/script&gt;
&lt;a href="#"&gt;
&lt;span&gt;foo&lt;/span&gt;
&lt;span&gt;bar&lt;/span&gt;
&lt;/a&gt;
Copy linkTweet thisAlerts:
@thejoker101authorFeb 12.2004 — is there any notable browsers that won't support that?
Copy linkTweet thisAlerts:
@thejoker101authorFeb 12.2004 — More specifically what I'm trying to do is adjust this example: http://www.alistapart.com/d/slidingdoors2/v1/ex8.html so that I can use text that is somewhat long only broken in the middle to have two lines of it.
Copy linkTweet thisAlerts:
@spufiFeb 12.2004 — In all honesty, I would really try to make the link use only a small amount of text. Could you give an example of your code?
Copy linkTweet thisAlerts:
@thejoker101authorFeb 12.2004 — The text length is really not variable, e.g.:

&lt;div id="header"&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="#"&gt;About the VPAST&lt;/a&gt;&lt;/li&gt;
&lt;li id="current"&gt;&lt;a href="#"&gt;ITUnits&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#"&gt;IT Policies&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#"&gt;IT Projects / Reports&lt;/a&gt;&lt;/li&gt;

<i> </i>&lt;li&gt;&lt;a href="#"&gt;Division of Continuing Ed.&lt;/a&gt;&lt;/li&gt;
<i> </i>&lt;li&gt;&lt;a href="#"&gt;Committees / Task Forces&lt;/a&gt;&lt;/li&gt;
<i> </i>&lt;li&gt;&lt;a href="#"&gt;Faculty Resources&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
Copy linkTweet thisAlerts:
@thejoker101authorFeb 13.2004 — so, any other thoughts?
Copy linkTweet thisAlerts:
@Aronya1Feb 14.2004 — How about just using 2 seperate links to the same target?

<li><a href="#">Division of </a><br>

<a href="#">Continuing Ed.</a></li>
Copy linkTweet thisAlerts:
@thejoker101authorFeb 14.2004 — won't work with the sliding doors example that I'm trying to use.
Copy linkTweet thisAlerts:
@PeOfEoFeb 14.2004 — [i]Originally posted by thejoker101 [/i]

[B]won't work with the sliding doors example that I'm trying to use. [/B][/QUOTE]
I looked at the link but what are you going for here? I mean the link was a tab strip looking thing, do you want a long link to wrap or something?
Copy linkTweet thisAlerts:
@Aronya1Feb 14.2004 — [B]I[/B] feel better... Thought I was just missing his point.
×

Success!

Help @thejoker101 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...