Home
Basics
Introduction Adding styles Selectors Headings and Text Lists Links Tables Colors Background Box Model Fonts Icons Display Position Overflow Align Images Tool tips FlexAdvanced
Shadows Rounded Corners Units Specificity Responsive design Media Queries Grid Animations Psuedo elements CSS variables and functions SASS and SCSSMiscellaneous
CSS Templates CSS Interview QnALinks in CSS
Links can be added using "a" tag. href attribute can be used to specify linked document and target attribute can be used to specify in which window/iframe/tab the new document should be opened.Styling links
By default, each a tag has below styles applied by user agent stylesheet(browser).
a:-webkit-any-link {
color: -webkit-link;
cursor: pointer;
text-decoration: underline;
}
e.g. To apply custom style like prev and next buttons displayed on this page, you can use css like below.
text-decoration: none;
display: block;
background-color: var(--primaryColor);
color: var(--secondaryColor);
padding: 10px;
border-radius: 5px;
a tag states
Links can be in below states.- :active
- :focus
- :visited
- :focus-visible
- :hover
- :target
- focus-within
Web development and Automation testing
solutions delivered!!