Click here to Skip to main content
15,889,335 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionDeny access to an aspx menu in webconfig, Role Based Authorization Pin
De_Novice26-Mar-11 10:19
De_Novice26-Mar-11 10:19 
AnswerRe: Deny access to an aspx menu in webconfig, Role Based Authorization Pin
Sandeep Mewara26-Mar-11 21:39
mveSandeep Mewara26-Mar-11 21:39 
QuestionHow to make the content Fixed Pin
the exile26-Mar-11 5:03
the exile26-Mar-11 5:03 
AnswerRe: How to make the content Fixed Pin
Ravi Sant26-Mar-11 6:45
Ravi Sant26-Mar-11 6:45 
GeneralRe: How to make the content Fixed Pin
the exile26-Mar-11 7:00
the exile26-Mar-11 7:00 
AnswerRe: How to make the content Fixed Pin
RaviRanjanKr26-Mar-11 7:16
professionalRaviRanjanKr26-Mar-11 7:16 
GeneralRe: How to make the content Fixed Pin
the exile26-Mar-11 22:26
the exile26-Mar-11 22:26 
GeneralRe: How to make the content Fixed [modified] Pin
msqar27-Mar-11 13:04
msqar27-Mar-11 13:04 
Its easy to add CSS in ASP.NET, as you do in HTML. The code will be basically look like this:

<link href="css/filename.css" rel="stylesheet" type="text/css">


Or you can even place it in the same masterpage like this, inside of the head tag, you add:

<style type="text/css">
    CSS ATTRIBUTES 
</style>


For instance, if you are using master pages, you have to add the css links inside of it (the masterpage).

I'm not a MASTER of web development, but i can help you with something...

CSS its easy as well, gonna make some examples for you.
Lets say we have the filename.css with:

body
{
background-color: #1e1e1e;
margin: 0px;
text-align: center;
font-family: Trebuchet MS;
}

The entire webpage if I let it this way, the font will be Trebuchet MS and it will be centered.

You have 3 ways for applying CSS. By ID, by Class or by Object.
By ID:
(ASP.NET)
<asp:TextBox ID="foo"/>


(CSS)

#foo
{
   color: #282828;
   font-size: 12px;
   font-family: Arial;
   border: 1px solid #fff;
}


Here, this ASP input text will have a 1px solid white border, the color of the text inside of it will be grey, Arial and 12px size.

By Class
(ASP.NET)
<asp:TextBox ID="foo" CssClass="input">


(CSS)

.input
{
   color: #282828;
   font-size: 12px;
   font-family: Arial;
   border: 1px solid #fff; 
}


This will contain the same attributes, but the only difference is that we changed them by class instead of ID.
If you have a lot of inputs its better for you to use classes rather than ID, ID is more unique related style, -when you have to change a single object style-.

Then you can also change all the inputs, all the selects, and so on of your site, like this:

input 
{
   color: #282828;
   font-size: 12px;
   font-family: Arial;
   border: 1px solid #fff; 

}


Where ALL the inputs will be under these style rules.

Next for you to know, is the positions, margins, paddings and floats.
Try to avoid using position: absolute or tables as one person said above, they aren't good, conceptually neither.
So the best way for you to create forms for example, is with DIVs and CSS, is even way better for reading and understanding.
After doing both ways, you realise of the quantity of lines used for nothing with tables and the worthless space they use.
Also, by using tables, each browser (firefox, chrome, opera, IE) has their own attributes for placing elements inside of rows/columns, so its not always the same way you see it in firefox than in others.

position: absolute attribute is better not to use it, as instead, try using float: left or float: right, with margin-left, margin-top, margin-right or margin-bottom properties.

The position: fixed, the one that you asked about, is to keep an element FIXED on the website and eventhough you resize the browser window, it will be mantained in the way you placed it in the window with CSS.

Hope it helps for something at least, happy designing/programming!

My best regards,

Marian.

EDITED: Oh what you can do to practice a LOT, is install the Firebug for Firefox and you can debug there in execution time, just simply "right click" in your site > Inspect Element, go to CSS tab, select the CSS file and edit it, change attributes, create new rules, etc... that's the way i learned, comparing results Big Grin | :-D

modified on Sunday, March 27, 2011 7:43 PM

GeneralRe: How to make the content Fixed Pin
the exile27-Mar-11 22:28
the exile27-Mar-11 22:28 
GeneralRe: How to make the content Fixed Pin
msqar28-Mar-11 1:16
msqar28-Mar-11 1:16 
AnswerRe: How to make the content Fixed Pin
Dalek Dave26-Mar-11 7:21
professionalDalek Dave26-Mar-11 7:21 
GeneralRe: How to make the content Fixed Pin
the exile26-Mar-11 22:31
the exile26-Mar-11 22:31 
Questionnand_bca@rediffmail.com Pin
Nand Kishor Chaudhary26-Mar-11 3:43
Nand Kishor Chaudhary26-Mar-11 3:43 
AnswerRe: change your subject Pin
Ravi Sant26-Mar-11 6:36
Ravi Sant26-Mar-11 6:36 
QuestionProblem updating DetailsView when added DropDownList Pin
kbalias24-Mar-11 23:39
kbalias24-Mar-11 23:39 
AnswerRe: Problem updating DetailsView when added DropDownList Pin
Cnu5555526-Mar-11 2:15
Cnu5555526-Mar-11 2:15 
Questionhow to copy row from one gridview to another,each time a new row is added........ Pin
Seema Rayat24-Mar-11 22:02
Seema Rayat24-Mar-11 22:02 
AnswerRe: how to copy row from one gridview to another,each time a new row is added........ Pin
Not Active25-Mar-11 1:23
mentorNot Active25-Mar-11 1:23 
GeneralRe: how to copy row from one radgrid to another,each time a new row is added........ Pin
Seema Rayat25-Mar-11 1:30
Seema Rayat25-Mar-11 1:30 
GeneralRe: how to copy row from one radgrid to another,each time a new row is added........ Pin
Not Active25-Mar-11 2:22
mentorNot Active25-Mar-11 2:22 
QuestionHow can i input "&" in the html code? Pin
buffering8324-Mar-11 15:13
buffering8324-Mar-11 15:13 
AnswerRe: How can i input "&" in the html code? Pin
GlobX24-Mar-11 15:52
GlobX24-Mar-11 15:52 
GeneralRe: How can i input "&" in the html code? Pin
Pravin Patil, Mumbai25-Mar-11 2:04
Pravin Patil, Mumbai25-Mar-11 2:04 
AnswerRe: How can i input "&" in the html code? Pin
Dalek Dave26-Mar-11 3:39
professionalDalek Dave26-Mar-11 3:39 
Questionfile download in mvc 2.0 Pin
rudra prasanna biswal24-Mar-11 11:45
rudra prasanna biswal24-Mar-11 11:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.