Home > Article > Web Front-end > How to set css a without line breaks
css How to set a without line breaks: first create a new html file and use the a tag to create a link; then add an id attribute to the a tag; then set the style of the a tag through id; finally add white- Set the space attribute to nowrap to force the text to not wrap.
The operating environment of this article: Windows7 system, HTML5&&CSS3 version, Dell G3 computer.
Create a new html file, named test.html, to explain how to use CSS to limit the text of A link to force it not to wrap.
In the test.html file, use the a tag to create a link for testing.
In the test.html file, add an id attribute to the a tag for the following style definition.
##In the test.html file, write the tag. The css style of the page will be written in this within the label. In the css tag, set the style of the a tag through the id, define the float to the left, the width is 50px, the background color is gray, and the white-space attribute is set to nowrap implements forced non-line wrapping of text. Even if the width is defined, it will still be displayed due to the forced non-line wrapping. Open the test.html file in the browser to check the effect. [Recommended learning:css video tutorial]
The above is the detailed content of How to set css a without line breaks. For more information, please follow other related articles on the PHP Chinese website!