pseudo-element

Using CSS :before and :after pseudo-elements with inline CSS?

拜拜、爱过 提交于 2020-01-08 14:06:20
问题 I'm making an HTML email signature with inline CSS (i.e. CSS in style attributes), and I am curious as to whether it's possible to use the :before and :after pseudo-elements. If so, how would I implement something like this with inline CSS? td { text-align: justify; } td:after { content: ""; display: inline-block; width: 100%; } 回答1: You can't specify inline styles for pseudo-elements. This is because pseudo-elements, like pseudo-classes (see my answer to this other question), are defined in

Using CSS :before and :after pseudo-elements with inline CSS?

℡╲_俬逩灬. 提交于 2020-01-08 14:06:05
问题 I'm making an HTML email signature with inline CSS (i.e. CSS in style attributes), and I am curious as to whether it's possible to use the :before and :after pseudo-elements. If so, how would I implement something like this with inline CSS? td { text-align: justify; } td:after { content: ""; display: inline-block; width: 100%; } 回答1: You can't specify inline styles for pseudo-elements. This is because pseudo-elements, like pseudo-classes (see my answer to this other question), are defined in

Text With ::before and ::after Not Centering Correctly?

家住魔仙堡 提交于 2020-01-07 04:58:13
问题 So I've got some text with an arrow in the pseudo ::after element. The arrow is a div with a border-bottom and border-right set to 1px solid. Here's the CSS: #arrow::after { position: relative; top: 5px; content: ""; display: inline-block; width: 30px; height: 30px; border-bottom: 1px solid white; border-right: 1px solid white; transform: rotate(-45deg); } #arrow:hover { color: #404040; cursor: pointer; } #arrow:hover::after { border-color: #404040; } I have the text that the arrow is

Modify jQuery javascript to trigger on :checked instead of :hover — image swap

…衆ロ難τιáo~ 提交于 2020-01-07 02:31:28
问题 I have a great piece of jQuery that swaps an image when the user hovers on an image. Check out the code below to see it. It uses mouseenter and mouseleave . I would like to modify it so that the image swap triggers when a specific input/label is :checked . You can see my demo page here: http://test.davewhitley.com/not-wp/static_folder/index.php To give you some background, I have 4 inputs/labels. When one is checked, a group of images will be swapped from black and white to their color

Modify jQuery javascript to trigger on :checked instead of :hover — image swap

烂漫一生 提交于 2020-01-07 02:31:28
问题 I have a great piece of jQuery that swaps an image when the user hovers on an image. Check out the code below to see it. It uses mouseenter and mouseleave . I would like to modify it so that the image swap triggers when a specific input/label is :checked . You can see my demo page here: http://test.davewhitley.com/not-wp/static_folder/index.php To give you some background, I have 4 inputs/labels. When one is checked, a group of images will be swapped from black and white to their color

CSS selector : after pseudo element of the last item of a list with a given class [duplicate]

空扰寡人 提交于 2020-01-06 05:16:26
问题 This question already has answers here : CSS last-child selector: select last-element of specific class, not last child inside of parent? (6 answers) Can I combine :nth-child() or :nth-of-type() with an arbitrary selector? (6 answers) :last-child not working as expected? (4 answers) CSS selector for first element with class (17 answers) Closed 2 months ago . I have 5 buttons. They have an underlayer that make them seem they are active, as you will see in the snippet. Each button can have an

Why does ::first-letter stop working as soon as I add display: flex or inline-flex?

梦想与她 提交于 2020-01-04 05:53:13
问题 I've implemented some ::first-letter styles for my p elements. However, when I add display: inline-flex to make them inline, all the ::first-letter styles stop working. How can I make the elements inline while keeping the ::first-letter styles? p:first-of-type::first-letter { font-size: 25px; font-weight: bold; } p:nth-of-type(2)::first-letter { font-size: 25px; font-weight: bold; } p:nth-of-type(3)::first-letter { font-size: 25px; font-weight: bold; } /* inline container */ p { display:

CSS Pseudo-elements :before & :after work differently in Internet Explorer

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-03 10:29:24
问题 I have a very specific problem as I am trying to create a navigation that has angles using purely CSS without images or javascript. I have figured it out so that it works perfectly but the problem I am coming across is that IE 9 and Chrome look different. I can get both to work by changing the margins of the pseudo elements but I would prefer a single solution to work in both. If anyone can figure out why the margins are different and give me a single CSS solution to work in both browsers

CSS pseudo-element size issue

两盒软妹~` 提交于 2020-01-03 08:41:37
问题 Please tell me why :before pseudo-element doesn't behave like a regular img in this case: Left one is div with an img inside and img 's width and height are equals 100% . Right one is div with :before and :before 's width and height are also 100% , but effect is different! (I know i can use a background-image workaround , but what is wrong with :pseudo when its content property is url() ?) Fiddle: http://jsfiddle.net/Tp9JG/4/ 回答1: Unfortunately you cannot control the size of the image when

How can I add a variable to a jquery selector of a pseudo-class?

泄露秘密 提交于 2020-01-03 05:20:12
问题 is it possible to add a variable to a jquery string selector of a pseudo-element? I've tried both codes below but none has seen to work, could you please assist me? $(function () { $("option").click(function(){ var filt1 = $(this).attr('id'); $("#filter2 option[class!=filt1]").hide(); $("#filter2 option[id*=filt1]").show(); }); }); and $(function () { $("option").click(function(){ var filt1 = $(this).attr('id'); $('#filter2 option[class!='+ filt1+ ']').hide(); $('#filter2 option[id*='+ filt1+