I have a doubt that in asp.net I am using CssClass class attribute for web server controls. And i am writing all the css code in style.css which will be in style folder of my project
<asp:TextBox ID="UserName" runat="server" CssClass="textEntry"></asp:TextBox>
The above is the example of the textbox.
Now the question is do i need to use link tag to say that my css file is located in style folder of my project?
Yes, you have to link the style sheet file (.css) by adding the link
tag.
You can also simply drag the css file into the html section of the .aspx code right under head
tag, that will work too - that will create the link for you.
Of course you need to link to your css file just like you do in regular html:
<link rel="stylesheet" type="text/css" href="style/mystyle.css">
While writing .aspx
file just think as if you are writing an HTML file with the ability to pre-process the page through the ASP.NET view engine (which is where the additional asp
tags come into play).
No, the tag is only used to apply a class within your CSS file. Just make sure you link your CSS file with your page as follows:
<head>
<link rel="stylesheet" type="text/css" href="path_to_your.css">
</head>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.