开发者

Html anchor tag

Do I need to wrap a tag (a href="#") in a <p> tag? I guess it can be wrapped in any block level element like div but 开发者_Go百科I'm not sure.


It is an inline element and doesn't have to be wrapped anywhere.

The page body is already a block-level element, so anything you have inside it is respectively wrapped by it.


No. If you want to make the anchor element block level you use the css property display: block;

<a href="http://www.google.com/mail" title="Google Web Mail" style="display: block;">Google Mail</a>

You can wrap an anchor in a p element if you want to do something like:

<p>My favorite search engine is <a href="http://www.google.com" title="Google Search Engine">Google</a>, because it allows me to fine tune my search</p>

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜