/    Sign up×
Community /Pin to ProfileBookmark

Target Parent Container’s Child CSS

I have a parent div (’email_shell’) with two child divs (’email_subscribe’ and ’email_image’).

The first child div (’email_subscribe’) is covered completely by a transparent input type=”image” file (’email_image’).

I want for this input’s active state to visually affect the first div (’email_subscribe’) in the parent div (’email_shell’) using only css.

How?

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@KDLAAug 20.2007 — Provide some of your code, and we can probably tell you. It's very difficult to do so without it.
Copy linkTweet thisAlerts:
@robindeanauthorAug 20.2007 — [CODE]#email_shell {height: 21px;}
#email_focus {width: 193px; height: 19px; border: 1px solid #aaaaaa; float: left; overflow: hidden; cursor: text;}
#email_input {width: 185px; height: 18px; margin: -1px 0 0 -1px; border: 0; padding: 3px 5px 0 5px; background: transparent; font-size: 12px; font-family: verdana, arial, helvetica; font-weight: bold; color: #ddaa33; float: left;}
#email_submit {float: right; overflow: hidden;}
#email_subscribe {width: 84px; height: 15px; border: 1px solid #aaaaaa; padding: 2px; text-align: center; font-weight: bold; color: #ddaa33;}
#email_image {width: 90px; height: 21px; margin-top: -21px; cursor: default;}[/CODE]


[CODE]<div id="email_shell">
<form method="post" action="newsletter/add.php">
<div id="email_focus">
<input type="text" id="email_input" value="Your Email Address">
</div>
<input type="hidden" value="Newsletter">
<input type="hidden" value="text">
<div id="email_submit">
<div id="email_subscribe">
Subscribe
</div>
<input type="image" src="submit.png" id="email_image"></div>
</form>
</div>[/CODE]


When "email_image" is active I want the border, background and text color to change in "email_subscribe" without the use of javascript.
×

Success!

Help @robindean 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,
)...