pseudo-element

Nesting pseudo-elements inside pseudo-elements

不羁的心 提交于 2019-11-26 12:29:21
问题 I have a :before for an opening \'quote\' and an :after for a closing quote. Now what I want is an :after:after for the \'cite\' reference but I cant get it to work. Does anyone know if this is possible? My code so far:- blockquote:before { content: \'\\201C\'; } blockquote:after { content: \'\\201D\'; } blockquote { font-size: 22px; line-height: 24px; text-indent:60px; } blockquote:before { font-size: 170px; margin-left: -136px; margin-top: 50px; opacity: 0.2; position: absolute; overflow

How do I access style properties of pseudo-elements with jQuery? [duplicate]

半城伤御伤魂 提交于 2019-11-26 12:29:08
This question already has an answer here: Selecting and manipulating CSS pseudo-elements such as ::before and ::after using jQuery 21 answers For context, this is a followup to an earlier question . Rather than digging through cssRules , I'd like to base the logic on jQuery selectors that search for the effects of those rules. Given default properties of .commentarea .author:before { background-image: url(http://...); background-position: -9999px -9999px; /* ... */ } that are selectively modified as in .author[href$="gbacon"]:before /* ... */ { content: ""; background-position: 0 -140px } how

Should I use single colons (:) or double colons (::) for before, after, first-letter and first-line pseudo-elements?

纵饮孤独 提交于 2019-11-26 12:27:44
问题 From MDN: The :: notation was introduced in CSS 3 in order to establish a discrimination between pseudo-classes and pseudo-elements. Browsers also accept the notation : introduced in CSS 2. If the notation : will always be accepted by CSS3 browsers, should I use it because it works on old and new browsers? Or should I use both of them, : for old browsers and :: for new ones, because the notation : won\'t be always accepted? Note : I think my question isn\'t a duplicate isn\'t a duplicate of

Font Awesome 5, why css content is not showing?

落爺英雄遲暮 提交于 2019-11-26 12:15:19
问题 I am trying to use FontAwesome in the content of css. It appears with the code for the icon instead of the icon. I have followed the online helps but still not working css @font-face { font-family: \'FontAwesome\'; src: url(\'https://use.fontawesome.com/releases/v5.0.6/css/all.css\'); } .fp-prev:before { color:#fff; content: \'/f35a\'; font-family: FontAwesome; font-style: normal; font-weight: normal; text-decoration: inherit; } 回答1: Read this if you are using the JS+SVG version: Font Awesome

Elongated hexagon shaped button using only one element

那年仲夏 提交于 2019-11-26 11:25:14
I would like to make a button like these one just with CSS without using another element. Button Image Since the button has a border attached, I think I normally need both, the :before and :after elements to create just one arrow at one side. So to make one arrow at each side I would need another span element inside the link. The second method I tried is the one you see below. But with this solution they are not properly centered and each side of the arrow is different in length. Has someone a solution? /* General Button Style */ .button { display: block; position: relative; background: #fff;

Font Awesome 5 - Choosing the correct font-family in CSS pseudo-elements

两盒软妹~` 提交于 2019-11-26 10:57:06
I'm currently confused in using the icon in CSS pseudo-elements. There are 4 kind of font-family for fontawesome : Font Awesome 5 Free , Font Awesome 5 Solid , Font Awesome 5 Brands , Font Awesome 5 Regular Here is the HTML : <h1>Hello</h1> Case 1 I use this icon : https://fontawesome.com/icons/twitter?style=brands As you can see, its a brands icon, so font-family : Font Awesome 5 Brands h1:before { display: inline-block; font-style: normal; font-variant: normal; text-rendering: auto; -webkit-font-smoothing: antialiased; content: "\f099"; /* TWITTER ICON */ font-family: "Font Awesome 5 Brands"

Html/Css Triangle with pseudo elements

时间秒杀一切 提交于 2019-11-26 10:57:00
I am trying to create a triangle shape with the pseudo elements. like the one in the image below. But this is what i get. Here is what i have tried this far. .container .form--container:before { content: ""; position: absolute; top: 0px; left: 130px; width: 28px; height: 28px; transform: translate(-1rem, -100%); border-left: 1.5rem solid #979797; border-right: 1.5rem solid #979797; border-bottom: 1.5rem solid white; } The issue is with the use of border. you can check this link How do CSS triangles work? and you will understand how border works and why you get this output. An alternative

Target :before and :after pseudo-elements with jQuery [duplicate]

假如想象 提交于 2019-11-26 09:48:15
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Manipulating CSS pseudo-elements using JQuery On pageload I want the :before and :after elements on a class to appear. I\'ve set the .lifted:before and .lifted:after to be opacity:0 in the css. Within document ready I have: $(\".lifted:before\").css(\"opacity\", \"1\"); $(\".lifted:after\").css(\"opacity\", \"1\"); This doesn\'t work. And the .after jQuery manipulator is only made for inserting content as far as

How can I make generated content selectable?

独自空忆成欢 提交于 2019-11-26 08:29:02
问题 I can have CSS display the ID for an element by using generated content, like this: <style> h2:hover:after { color: grey; content: \"#\" attr(id); float: right; font-size: smaller; font-weight: normal; } </style> <h2 id=\"my-id\">My ID</h2> <p>Pellentesque habitant morbi tristique senectus et netus et.</p> How can I make that generated content (\"#my-id\") selectable so that the user can highlight and copy it? 回答1: You can't make a pseudo-element selectable, as it doesn't exist in the DOM. 5

::before pseudo-element stacking order issue

空扰寡人 提交于 2019-11-26 08:28:29
问题 When statically positioned, the ::before pseudo-element stacks (z-index) before the child\'s content, but after the child\'s background. Can anyone explain why or even how this is happening or if this is an issue that all major browsers have? <style> div { background-color:yellow; width:400px; } div::before { background-color:red; content:\"div::before\"; } div::after { background-color:green; content:\"div::after\"; } div p { background-color:blue; color:white; margin:-15px 0; padding:0; } <