Kevin Fischer
Kevin Fischer

Reputation: 352

CSS, Classic ASP, Checkbox

I am trying to get my stylesheet to implement changes to a checkbox. I know the CSS is good because when it was inline, it worked like a champ.

internal_users.asp is the one that needs to be formatted but it inherits (similar to a masterpage) from i_internal_headers.asp where the styles are implements.

code:

stylesheet:
.checkbox {
margin: 4px 0;
padding: 0;
width:50px;
border:none;
background:none;
}

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

internal_users.asp
<!-- #include file="include/i_internal_headers.asp" -->
<input type="checkbox" class="styled" value="" />

I have also tried on the stylesheet input[type=checkbox] {}

I also tried creating a brand new stylesheet called TrialCheckboxStylesheet.css and placed all of the css in there. still didn't work. and yes i put a new link ref in i_internal_headers

EDITTED: My current code looks like this:

.cbClear {
margin: 4px 0;
padding: 0;
width:50px;
border:none;
background:none;

}

<input type="checkbox" class="cbClear" value="" />.

When using Developer Tools on IE, I found this

#rightcolumn input, #rightcolumn textarea, #rightcolumn select { 
padding: 5px; 
width: 299px; 
font: 100% arial; 
border: 1px solid #D5D5D5; 
background: #FFF; 
color: #47433F;
border-radius: 7px 7px 7px 7px;
-moz-border-radius: 7px 7px 7px 7px;
-webkit-border: 7px 7px 7px 7px;  

}

which seems to be overriding the other CSS for the checkbox. So, how would I get the checkbox one to have priority over the other?

Upvotes: 3

Views: 659

Answers (2)

Kevin Fischer
Kevin Fischer

Reputation: 352

This is what I had to do

#rightcolumn input.cbClear {
margin:4px 0 !important;
padding:0 !important;
width:50px !important;
border:none !important;
background:none !important;

}

inside the stylesheet.css

This made it the priority to override the prior CSS

Thank you Tetsujin no Oni for the help and quick answers.

Upvotes: 1

th1rdey3
th1rdey3

Reputation: 4358

I think your problem lies in the relative path of the css. As far I can assume your file structure is something like the following

root
|
|-include
  |-i_internal_headers.asp
|-css
  |-stylesheet.css
|-internal_users.asp

so when you are calling internal_users.asp file from browser it looks for the stylesheet.css file in a css folder which is located in the parent folder of the root folder. this problem occurs because you have given relative path for the stylesheet in i_internal_headers.asp

to solve this problem change the relative path to absolute path. like this -

<link rel="stylesheet" type="text/css" href="/css/stylesheet.css"><!-- remove the two dots in from of /css -->

this tells the server that the stylesheet is located under root/css folder.

Upvotes: 0

Related Questions