/    Sign up×
Community /Pin to ProfileBookmark

form element display issues

I’m just not finding the answers for this one in the tutorials out there. I’m wanting to control the display of my form elements, specifically text input boxes on a given page. Here are my questions…

First, I am already using an external style sheet and would like to put this in there as well. The problem is that I have different styles on inputs on different pages, so if I go with a simple

input[“text”] {background-color: #000000;}

then it will make all of my input elements comply on all pages, which I don’t want. So question number one is can I use a separate identifier to say that input elements within a specified class or id use these rules? I’ve tried a few different combinations and none work. Also, what is the exact syntax for controlling the height of an input element? I can’t seem to get that right either. Say I’m using 8px font in a given span, the input elements always dwarf the text around them.

Now, if I can’t put different specifications in my external style sheet what would be the syntax for just doing this inline? Can I put it directly into the <input> tag? Actually I think I know the answer to that is no as I’ve been trying and it isn’t working. So if I can, a syntax example would be great. Thanks.

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@KDLAJun 19.2007 — Use classes:
<i>
</i>&lt;style type="text/css"&gt;
input {background-color: #fff; height: 14px; font-size: 8px;}
input.black {background-color: #000; height: 14px; font-size: 8px;}
&lt;/style&gt;

<i>
</i>&lt;input type="text" class="black" /&gt;


And, yes, you can put things inline:
<i>
</i>&lt;input type="text" style="background: #000; height: 14px; font-size: 8px;" /&gt;
×

Success!

Help @mwmwnmw spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...