genxgeek
genxgeek

Reputation: 13357

CSS style override default textbox border to create invisible border?

I want to display a text box in css/razor without the border (well, as white background) but it's picking up the color value from it's parent.

Q: How can I override the default value in the parent css style so my textbox value looks like a label (white background color)?

input[type="text"], 
input[type="password"], select {
border: 1px solid #93A9C8;  }

.TextBoxAsLabel
{
   border: none;
   background-color: #fff;
   background: transparent;
}

-- Called from razor page --

@Html.TextBoxFor(m => m.ImpToDate, new { @class = "TextBoxAsLabel" })

Upvotes: 0

Views: 7310

Answers (2)

corroded
corroded

Reputation: 21564

try: input.TextBoxAsLabel

This makes your class more specific and will probably override the previous one.

Upvotes: 1

JoshMWilliams
JoshMWilliams

Reputation: 2384

Simply change the border value from none to 0 (zero)

Upvotes: 0

Related Questions