Can I use a :before or :after pseudo-element on an input field?

:before and :after render inside a container and <input> can not contain other elements. Pseudo-elements can only be defined (or better said are only supported) on container elements. Because the way they are rendered is within the container itself as a child element. input can not contain other elements hence they’re not supported. A button … Read more

How do I style a dropdown with only CSS?

Here are three solutions: Solution #1 – appearance: none – with Internet Explorer 10 – 11 workaround (Demo) — To hide the default arrow set appearance: none on the select element, then add your own custom arrow with background-image select { -webkit-appearance: none; -moz-appearance: none; appearance: none; /* Remove default arrow */ background-image: url(…); /* Add custom … Read more

How to apply CSS to iframe?

Edit: This does not work cross domain unless the appropriate CORS header is set. There are two different things here: the style of the iframe block and the style of the page embedded in the iframe. You can set the style of the iframe block the usual way: <iframe name=”iframe1″ id=”iframe1″ src=”https://stackoverflow.com/questions/217776/empty.htm” frameborder=”0″ border=”0″ cellspacing=”0″ … Read more