As kind a newbie I have a simple question. Having a textfield with background-color and border I want to give opacity value only to the background and not to the border:

#textfield {
background-color:#2875DE;
border:2px solid #2cb823;
}
#textfield.background-color {
filter:alpha(opacity=60);
}

This obviously won't work and any ideas of making the textfield with oval shape with opacity only for the background will be much appreciated.

Recommended Answers

All 2 Replies

Well, I'm not very good with CSS either, but what I've always done is use a 1 pixel PNG image as the background whenever I need to use opacity. I know there's better ways, but it's always worked fine for me.

Hi there,

Check this code:

#textfield {
  width:400px;
  height:180px;
  margin:30px 50px;
  background-color:blue;
  border:2px solid #2cb823;
  /* for IE */
  filter:alpha(opacity=60);
  /* CSS3 standard */
  opacity:0.6;
}

It might help you.

Regards
Surya

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.