473,399 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

CSS Question - Overriding or slimming down element styles

Hi, apologies if this is out of scope but I cannot find a dedicated CSS
newsgroup..but I am using .net!

I have a css definition for the element 'input'. So it puts boxes round all
my inputs in black, 2px etc etc so i dont have to give each input a class
name in my html - this way it does it automatically. However .. when i create
an <asp:ImageButton> this also gets transformed on the client as an <input
type=image> therefore it picks up this style and i get horrible boxes around
my buttons. Rather than apply class=box to every single text input (there are
many) is there any way I can slim it down to

input type=text { style def } (tried this and doesnt work)
?? either that or override the style for an image and just make the style
blank?

Thanks.
Nov 18 '05 #1
2 1095
You can either add a style element to each imagebutton:

<asp:ImageButton id="ImageButton1" runat="server" style="border: 0px"
imageurl="myimage.gif">

or you could create a new css class and use that:

<style>
INPUT.noborder {border: 0px;}
</style>

and

<asp:ImageButton id="ImageButton1" runat="server" cssclass="noborder"
imageurl="myimage.gif">

HTH

Alan

"louise raisbeck" wrote:
Hi, apologies if this is out of scope but I cannot find a dedicated CSS
newsgroup..but I am using .net!

I have a css definition for the element 'input'. So it puts boxes round all
my inputs in black, 2px etc etc so i dont have to give each input a class
name in my html - this way it does it automatically. However .. when i create
an <asp:ImageButton> this also gets transformed on the client as an <input
type=image> therefore it picks up this style and i get horrible boxes around
my buttons. Rather than apply class=box to every single text input (there are
many) is there any way I can slim it down to

input type=text { style def } (tried this and doesnt work)
?? either that or override the style for an image and just make the style
blank?

Thanks.

Nov 18 '05 #2
wicked. so you extend the class with input.whatever
simple in theory!
great thank you.

"Alan Lambert" wrote:
You can either add a style element to each imagebutton:

<asp:ImageButton id="ImageButton1" runat="server" style="border: 0px"
imageurl="myimage.gif">

or you could create a new css class and use that:

<style>
INPUT.noborder {border: 0px;}
</style>

and

<asp:ImageButton id="ImageButton1" runat="server" cssclass="noborder"
imageurl="myimage.gif">

HTH

Alan

"louise raisbeck" wrote:
Hi, apologies if this is out of scope but I cannot find a dedicated CSS
newsgroup..but I am using .net!

I have a css definition for the element 'input'. So it puts boxes round all
my inputs in black, 2px etc etc so i dont have to give each input a class
name in my html - this way it does it automatically. However .. when i create
an <asp:ImageButton> this also gets transformed on the client as an <input
type=image> therefore it picks up this style and i get horrible boxes around
my buttons. Rather than apply class=box to every single text input (there are
many) is there any way I can slim it down to

input type=text { style def } (tried this and doesnt work)
?? either that or override the style for an image and just make the style
blank?

Thanks.

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dietmar Gräbner | last post by:
Hi Right now I'm dealing with derivation by restriction and I have some questions concerning the attribute property use in context of the derivation. Consider following Schema: <xs:schema...
2
by: Anna | last post by:
Hi all. I want to create a noframes version of a certain page (not written by me), that has three frames, each loading a page with few external stylesheets. If I copy the content of each...
5
by: didier Belot | last post by:
Hi! If the subject isn't clear: Modern browsers provide an optional way of remembering user input in textbox: user begin to type, and a list drop down just under the textbox showing matching...
2
by: Sergey Ilinsky | last post by:
How can i override all the styles being cascaded applied to some HTML element? For example: I have a stylesheet where DIV styles are described DIV { padding: 10; margin: 10; }
6
by: Bern McCarty | last post by:
I'm trying to use the VS 2005 March Tech Preview and am trying to adjust some MC++ to the new C++/CLI syntax. I got a little hung up when I encountered the below error. Certainly my...
2
by: Randall Arnold | last post by:
I've written an app in VB.NET 2005 Beta that monitors temperature of several devices. I am using the ProgressBar for visual indication of temperature; all readings in expected range cause the bar...
3
by: Iain | last post by:
I'm writing a server control which is a navigation bar. My prototype uses id based styles to control the layout and dynamics. Is there any way I can override asp.net's processing of the ID so...
4
by: splounx | last post by:
Hi there, I am a relative CSS & JavaScript novice and I have a particular problem that is beyond my level of knowledge so I thought I'd tap the collective wisdom of this group. I would like...
10
by: r035198x | last post by:
The Object class has five non final methods namely equals, hashCode, toString, clone, and finalize. These were designed to be overridden according to specific general contracts. Other classes that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.