css-selectors

Automatically style each link on a page differently using nth-child/type?

≡放荡痞女 提交于 2021-01-29 03:08:49
问题 I want to add a special style to specific links on my page but I don't want to add a separate class to each link that might appear on a page. I want every 8n+1 (through 8n+8) href to be a different color. So far it's not working using nth-child or nth-of-type. I assume this is because the links are in paragraphs and lists, etc., so they aren't recognized as direct or even sibling selectors, even though the parent selector I'm prefixing it with is the parent. Here's my CSS: #main > a:nth-of

CSS classes with special characters

99封情书 提交于 2021-01-29 02:20:32
问题 I have a WebApp where I need to manipulate certain elements using a CSS file. The CSS classes contain square brackets and other special characters. At least chrome doesn't seem to accept them directly. <div class="profileElement profile[~redString]">123</div> Is this class even valid? Is there a way to use the classname? I want: .profile[~redString]{ color: red; } When I escape the ~ with a backslash chrome allows me to inject (F12 -> Elements -> the plus symbol on the top right) it to the

CSS classes with special characters

时光怂恿深爱的人放手 提交于 2021-01-29 02:15:11
问题 I have a WebApp where I need to manipulate certain elements using a CSS file. The CSS classes contain square brackets and other special characters. At least chrome doesn't seem to accept them directly. <div class="profileElement profile[~redString]">123</div> Is this class even valid? Is there a way to use the classname? I want: .profile[~redString]{ color: red; } When I escape the ~ with a backslash chrome allows me to inject (F12 -> Elements -> the plus symbol on the top right) it to the

css :not() selector not working with universal selector (*) [duplicate]

眉间皱痕 提交于 2021-01-28 16:44:51
问题 This question already has an answer here : Not getting correct output by :not() pseudo class (1 answer) Closed 8 months ago . Haii Looks like the css selector :not() doesn't work well with the * selector. Any way around it? Or am I doing something wrong? *:not(.nope){ color: green; } <div>hai</div> <div>I</div> <div class="nope">am</div> <div>Jhon</div> I still get 'am' as green. Thanks in advance! 回答1: The universal selector ( * ) is not the problem. It's the inheritance on the color

css :not() selector not working with universal selector (*) [duplicate]

半腔热情 提交于 2021-01-28 16:43:57
问题 This question already has an answer here : Not getting correct output by :not() pseudo class (1 answer) Closed 8 months ago . Haii Looks like the css selector :not() doesn't work well with the * selector. Any way around it? Or am I doing something wrong? *:not(.nope){ color: green; } <div>hai</div> <div>I</div> <div class="nope">am</div> <div>Jhon</div> I still get 'am' as green. Thanks in advance! 回答1: The universal selector ( * ) is not the problem. It's the inheritance on the color

Different behavior for pseudo-class with space and without space

扶醉桌前 提交于 2021-01-28 14:33:18
问题 This issue is related to CSS pseudo-class. I refer to :last-child just for example, I suppose it happens to all other pseudo-class too. Given I have following simple HTML: <body> <p>Paragraph1</p> <p>Paragraph2</p> </body> I add following CSS: body:last-child{ color:red; } <body> <p>Paragraph1</p> <p>Paragraph2</p> </body> Without space both paragraphs will be marked as red When I will set space between .body and :last-child, only second paragraph will be marked as red - that happens in

Different behavior for pseudo-class with space and without space

天涯浪子 提交于 2021-01-28 14:20:41
问题 This issue is related to CSS pseudo-class. I refer to :last-child just for example, I suppose it happens to all other pseudo-class too. Given I have following simple HTML: <body> <p>Paragraph1</p> <p>Paragraph2</p> </body> I add following CSS: body:last-child{ color:red; } <body> <p>Paragraph1</p> <p>Paragraph2</p> </body> Without space both paragraphs will be marked as red When I will set space between .body and :last-child, only second paragraph will be marked as red - that happens in

How to click the Continue button within https://in.indeed.com/ website using selenium in python?

故事扮演 提交于 2021-01-28 12:30:17
问题 I am trying to write a code that is able to auto apply on job openings on indeed.com. I have managed to reach the last stage, however, the final click on the application form is giving me a lot of trouble. Please refer the page as below Once logged in to my profile, I go to the relevant search page, click on the listing I am interested in and then on the final page (shown above) I am trying to click on the continue button using xpath. For the previous step (also a page on the same form), the

How to click the Continue button within https://in.indeed.com/ website using selenium in python?

一世执手 提交于 2021-01-28 12:18:43
问题 I am trying to write a code that is able to auto apply on job openings on indeed.com. I have managed to reach the last stage, however, the final click on the application form is giving me a lot of trouble. Please refer the page as below Once logged in to my profile, I go to the relevant search page, click on the listing I am interested in and then on the final page (shown above) I am trying to click on the continue button using xpath. For the previous step (also a page on the same form), the

How to click on the radio button through the element ID attribute using Selenium and C#

倾然丶 夕夏残阳落幕 提交于 2021-01-28 09:50:14
问题 I am trying to select a radio button and input element, it has an id of group and value of In_Group . There are 4 different radio buttons with the same id but different values hence I am trying to select the correct one i am looking for. <input class="custom-radio" id="group" name="group" type="radio" value="In_Group"> I tried something like this: driver.FindElement(By.XPath("//*[contains(@id='group' and @value='In_Group')]")) But the element is not found could someone help me out 回答1: To