From 1766e8fa101a7c9814f1889a55b2c16c89adb22e Mon Sep 17 00:00:00 2001 From: Dhirendra Date: Sat, 9 Mar 2019 04:46:07 +0530 Subject: [PATCH] Update index.md (#24818) Add hint with example to use Attribute Selectors --- .../index.md | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/guide/english/certifications/responsive-web-design/basic-css/use-attribute-selectors-to-style-elements/index.md b/guide/english/certifications/responsive-web-design/basic-css/use-attribute-selectors-to-style-elements/index.md index 3d06f416e0..685c85bbc5 100644 --- a/guide/english/certifications/responsive-web-design/basic-css/use-attribute-selectors-to-style-elements/index.md +++ b/guide/english/certifications/responsive-web-design/basic-css/use-attribute-selectors-to-style-elements/index.md @@ -3,8 +3,26 @@ title: Use Attribute Selectors to Style Elements --- ## Use Attribute Selectors to Style Elements -This is a stub. Help our community expand it. +You can also apply styling to elements by their attribute values. -This quick style guide will help ensure your pull request gets accepted. - - +### For Example +1. If you want to style all the checkboxes on the page, you can do. + ``` + [type='checkbox'] { + // CSS styling + } + ``` +2. This also works with custom attribute, lets say you have two elements with attribute named `foo`. + ``` +

foo bar

+

foo baz

+ ``` + You can use attribute to style them differently. + ``` + [foo='bar'] { + color: red; + } + [foo='baz'] { + color: purple; + } + ```