The :link signifies unvisited hyperlinks.
The :visited signifies visited hyperlinks.
The :hover signifies an element that currently has the user's mouse pointer hovering over it.
The :active signifies an element on which the user is currently clicking.
a:link
- a normal, unvisited linka:visited
- a link the user has visiteda:hover
- a link when the user mouses over ita:active
- a link the moment it is clickeda:link {color: blue:} a:visited {color: purple;} a:hover {color: cyan;} a:active {color: red;}
Fra: https://www.internetingishard.com/html-and-css/css-selectors/ (som har mye bra!).
:link
– A link the user has never visited.:visited
– A link the user has visited before.:hover
– A link with the user’s mouse over it.:active
– A link that’s being pressed down by a
mouse (or finger).a:link { color: blue; text-decoration: none; } a:visited { color: purple; } a:hover { color: aqua; text-decoration: underline; } a:active { color: red; }
If you’ve never been to the InternetingIsHard.com home page, you should see a blue link. Otherwise, you’ll see a purple link. When you hover over the link, it will turn aqua, and when you push down on it, it’ll turn red.
The above snippet is just fine for most websites, but take a closer look at
the a:visited
behavior by changing the href
attribute
to a URL that you’ve been to before. Our a:hover
style is
applied to both visited and unvisited links. We can refine our links even more
by stringing pseudo-classes together. Add this below the previous snippet:
a:visited:hover {
color: orange;
}
Som gir følgende InternetingIsHard.com resultat.
This creates a dedicated hover style for visited links. Hovering over an
unvisited link changes it to aqua, while hovering over a visited link will turn
it orange. Fantastic! Except for the fact that this breaks our
a:active
style due to some complicated CSS internals that
you’ll never want to read about. When you click down, our link
won’t turn red anymore.
We can fix that with a:visited:active
. Add the following to the
end of our stylesheet. Note that, as with our .call-to-action
class, the order in which these are defined in styles.css
matters:
a:visited:active {
color: red;
}
Som gir følgende InternetingIsHard.com resultat.
These last two sections let you style visited links entirely separately from unvisited ones. It’s a nice option to have, but again, you’re welcome to stop at basic link styles if that’s all you need.
a.testing1 {color: blue; text-decoration: none;} a.testing1:visited {color: yellow;} a.testing1:hover {color: fuchsia;} a.testing1:active {color: red;}
a.testing2:link {color: green; text-decoration: none;} a.testing2:visited {color: yellow;} a.testing2:hover {color: orange;} a.testing2:active {color: fuschia;}
a:link.tester1, a:visited.tester1, a:active.tester1 { color: DeepPink; } a:hover.tester1 { color: Black; }
a.tester2:link, a.tester2:visited, a.tester2:active { color: DeepPink; } a.tester2:hover { color: Black; }
.tester3:link, .tester3:visited, .tester3:active { color: DeepPink; } .tester3:hover { color: Black; }
.tester4 a:link, .tester4 a:visited, .tester4 a:active { color: DeepPink; } .tester4 a:hover { color: Black; }
<ol> <li><a class="tester1" href="nettside1.no/">a:link.CLASS1</a></li> <li><a class="tester2" href="nettside2.no/">a.CLASS2:link</a></li> <li><a class="tester3" href="nettside3.no/">.CLASS3:link</a></li> <li><a class="tester4" href="nettside4.no/">.CLASS4 a:link</a></li> </ol>
<div class="tester1"> <ol><li><a href="nettside1.no/">a:link.CLASS1</a></li></ol> </div> <div class="tester2"> <ol><li><a href="nettside2.no/">a.CLASS2:link</a></li></ol> </div> <div class="tester3"> <ol><li><a href="nettside3.no/">.CLASS3:link</a></li></ol> </div> <div class="tester4"> <ol><li><a href="nettside4.no/">.CLASS4 a:link</a></li></ol> </div>
DET BESTE og ENKLESTE er å samle innholdet i en DIV, og så knytte den til hver av tagene i den.
h1 { } p { } a { } a:hover { }
.samling h1 { } .samling p { } .samling a { } .samling a:hover { }
<div class="samling"> <h1>Bla... <p>Bla... <a href... </div>
Det nedenfor er det jeg testet innledningsvis, før jeg fant ut av det nevnt over. Lar det stå. Kan også brukes slik.
En a:link
kan endres til a.classnavn:link
for CSS.
Tilhørende HTML vil da bli gitt en <a class="classnavn" href...
.
Eventuelt så kan en a:link
endres til #idnavn a:link
for CSS.
Tilhørende HTML vil da bli gitt en <a id="idnavn" href...
.
h1 a { color: #EBE6C8; text-decoration: none; } h1 a:hover { color: blue; }
Med h1 a {...}
, styres alle <a>
som er på innsiden av <h1>
elementer.
En ren <a>
og en ren <h1>
påvirkes ikke av stylingen.
En h1 a {...}
multi-tag kombinasjon kan også settes opp som en CLASS: h1.a-inni-hx
.
.a-inni-hx a { color: #EBE6C8; text-decoration: none; } .a-inni-hx a:hover { color: #FFFF20; }
Uten h1
foran .a-inni-hx
kan den gjenbrukes på flere forskjellige elementer, eksempelvis en h3
tag.
<h3 class="a-inni-hx"><a href="#">Link Inside Heading</a></h3>
Dersom a {...}
blir stående alene, vil alle rene <a href...
bli styrt med stylingen som den viser.
Samtidig vil h1 a:hover {...}
styre alle a:hover {...}
som befinner seg inne i <h1>
tager.
Det betyr at <a href>
mister sin hover
-funksjon, hvis den da ikke også er definert som en egen a:hover {...}
.
a { color: #EBE6C8; text-decoration: none; } h1 a:hover { color: #FFFF20; }
<a href="/hvasomhelst/notvisited">Styled Links</a> <h3 class="a-inni-hx"><a href="#">Link Inside Heading</a></h3>
Notes: You can not use name
attribute instead of id
attribute.
Because name
attribute not supported in HTML5. Use the id
attribute instead of.
First, use the id attribute to create a bookmark:
<h2 id="C4">Chapter 4</h2>
Then, add a link to the bookmark ("Jump to Chapter 4"), from within the same page:
<a href="#C4">Jump to Chapter 4</a>
You can also add a link to a bookmark on another page:
<a href="html_demo.html#C4">Jump to Chapter 4</a>
PB: Bruk av ID for intern-linking.
<div id="en-stilsetting"> <div class="annen">Which paragraph do you want to scroll to?</div> <ul> <li><a href="#one">Paragraph One</a></li> <li><a href="#two">Paragraph Two</a></li> <li><a href="#three">Paragraph Three</a></li> <li><a href="#four">Paragraph Four</a></li> <li><a href="#five">Paragraph Five</a></li> </ul> </div> <p id="one">Enerens tekst.</p> <p id="two">Toerens tekst.</p> <p id="three">Treerens tekst.</p> <p id="four">Firerens tekst.</p> <p id="five">Femerens tekst.</p> </div>
1. Enerens tekst.
2. Toerens tekst.
3. Treerens tekst.
4. Firerens tekst.
5. Femerens tekst.
As mentioned before, you can't use inline elements for styling pseudo classes. Before and after pseudo classes are states of elements, not actual elements. You could only possibly use JavaScript for this.
<a href="#" onmouseover = "this.style.textDecoration = 'none'" onmouseout = "this.style.textDecoration = 'underline'">Hello</a> <a href="#" onmouseover = "this.style.background = '#d5efc2'" onmouseout = "this.style.background = 'SandyBrown'">Hello</a> <a href="#" onmouseover = "this.style.color = '#090'" onmouseout = "this.style.color = '#900'">Hello</a>
It's not CSS but it works for :hover using mouseover and mouseout, :focus using onfocus and onblur, and :active using onclick. Dette er javascript.
PB ... test ut i forskjellige kombinasjoner. Kan være greit å bruke dette på testsiden her, fremfor CSS under STYLE på toppen av siden!
PB: Andre alternativ funnet:
<a href="http://www.google.com" style="hover:text-decoration:none;">Google</a>Google
<a href="http://www.google.com" id="gLink">Google</a> <style> #gLink:hover { text-decoration: none; } </style>Google Text
Har fått samlet noe mer sammen enn originalen som hadde alt fordelt med full standard pakke på alle 4 x 4, og da uten 0.
Det var ingen CLASS heller, alt som standard for alle linker på siden.
Testet ut forskjellige plasseringer av CLASS i CSS. Slik det ligger fremme fungerer det.
Også med egen text-decoration: underline;
på den samlede biten.
.testmoro0 a:link, .testmoro0 a:visited, .testmoro0 a:active { font-size: 52pt; color: DeepPink; text-decoration: none; } .testmoro0 a:hover { color: Black; text-decoration: underline; } a:link .testmoro1, a:visited .testmoro1, a:active .testmoro1 { color: #708090; text-decoration: none; } a:hover .testmoro1 { color: cyan; text-decoration: none; } a:link .testmoro2, a:visited .testmoro2, a:active .testmoro2 { color: #708090; text-decoration: none; } a:hover .testmoro2 { color: magenta; text-decoration: none; } a:link .testmoro3, a:visited .testmoro3, a:active .testmoro3 { color: #708090; text-decoration: none; } a:hover .testmoro3 { color: lime; text-decoration: none; } a:link .testmoro4, a:visited .testmoro4, a:active .testmoro4 { color: #708090; text-decoration: none; } a:hover .testmoro4 { color: SandyBrown; text-decoration: none; }
<div class="testmoro0"> <a href="//"> <span class="testmoro1">T</span> <span class="testmoro2">E</span> <span class="testmoro3">S</span> <span class="testmoro4">T</span> </a> </div>
CSS allows us to style links as desired. We can format text, by adding colors, background, increase size, etc. Furthermore, animations can be added to create a pleasant visual effect.
For proper functionality, the order of pseudo selectors is given by:- :link, :visited, :hover, :active.
p { margin: 25px; } #mod { padding: 10px; color: darkturquoise; border: thin solid; background-color: lemonchiffon; } #mod:hover { color: white; box-shadow: 0 0 0 1px black; background-color: slateblue; }
<p> <a href="mailto:user@example.com">Demo link</a> </p> <p> <a id="mod" href="mailto:user@example.com">Modified demo link</a> </p>
div { margin: 25px; display: flex; float: left; border: thin solid; background-color: snow; padding: 20px; } body * { border-radius: 5%; } #mod { padding: 10px; color: royalblue; text-decoration: none; } #mod:hover { box-shadow: 0 0 10px 2px black; text-decoration: overline; font-size: 1.2em; }
<button><a href="#">Demo</a></button> <a id="mod" href="#">Demo</a>
Here are the states you can change link color for with CSS:
a:link
– represents a link that the user hasn't visited.a:visited
– indicates a link that's been visited by the user before.a:hover
– shows a link with the user's cursor over it.a:active
– marks a link that's being pressed down.Links can be styled with any CSS property (e.g. color
, font-family
, background
, etc.).
a { color: hotpink; }
<p><b><a href="default.asp" target="_blank">This is a link</a></b></p>
In addition, links can be styled differently depending on what state they are in.
The four links states are:
a:link
- a normal, unvisited linka:visited
- a link the user has visiteda:hover
- a link when the user mouses over ita:active
- a link the moment it is clicked/* unvisited link */ a:link { color: red; } /* visited link */ a:visited { color: green; } /* mouse over link */ a:hover { color: hotpink; } /* selected link */ a:active { color: blue; }
Note: a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective.
Note: a:active MUST come after a:hover in the CSS definition in order to be effective.
The text-decoration
property is mostly used to remove underlines from links:
a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: underline; } a:active { text-decoration: underline; }
The background-color
property can be used to specify a background color for links:
a:link { background-color: yellow; } a:visited { background-color: cyan; } a:hover { background-color: lightgreen; } a:active { background-color: hotpink; }
This example demonstrates a more advanced example where we combine several CSS properties to display links as boxes/buttons:
a:link, a:visited { background-color: #f44336; color: white; padding: 14px 25px; text-align: center; text-decoration: none; display: inline-block; } a:hover, a:active { background-color: red; }
a.one:link {color:#ff0000;} a.one:visited {color:#0000ff;} a.one:hover {color:#ffcc00;}
<p><b><a class="one" href="default.asp" target="_blank">This link changes color</a></b></p>
a.two:link {color:#ff0000;} a.two:visited {color:#0000ff;} a.two:hover {font-size:150%;}
<p><b><a class="two" href="default.asp" target="_blank">This link changes font-size</a></b></p>
a.three:link {color:#ff0000;} a.three:visited {color:#0000ff;} a.three:hover {background:#66ff66;}
<p><b><a class="three" href="default.asp" target="_blank">This link changes background-color</a></b></p>
a.four:link {color:#ff0000;} a.four:visited {color:#0000ff;} a.four:hover {font-family:monospace;}
<p><b><a class="four" href="default.asp" target="_blank">This link changes font-family</a></b></p>
a.five:link {color:#ff0000;text-decoration:none;} a.five:visited {color:#0000ff;text-decoration:none;} a.five:hover {text-decoration:underline;}
<p><b><a class="five" href="default.asp" target="_blank">This link changes text-decoration</a></b></p>
Another example of how to create link boxes/buttons:
a:link, a:visited { background-color: white; color: black; border: 2px solid green; padding: 10px 20px; text-align: center; text-decoration: none; display: inline-block; } a:hover, a:active { background-color: green; color: white; }
<a href="default.asp" target="_blank">This is a link</a>
This example demonstrates the different types of cursors (can be useful for links):
<span style="cursor: auto">auto</span><br> <span style="cursor: crosshair">crosshair</span><br> <span style="cursor: default">default</span><br> <span style="cursor: e-resize">e-resize</span><br> <span style="cursor: help">help</span><br> <span style="cursor: move">move</span><br> <span style="cursor: n-resize">n-resize</span><br> <span style="cursor: ne-resize">ne-resize</span><br> <span style="cursor: nw-resize">nw-resize</span><br> <span style="cursor: pointer">pointer</span><br> <span style="cursor: progress">progress</span><br> <span style="cursor: s-resize">s-resize</span><br> <span style="cursor: se-resize">se-resize</span><br> <span style="cursor: sw-resize">sw-resize</span><br> <span style="cursor: text">text</span><br> <span style="cursor: w-resize">w-resize</span><br> <span style="cursor: wait">wait</span>
<a href="https://www.w3schools.com/" target="_blank">Visit W3Schools!</a>
Dette er en ekstern link-tekst: Visit W3Schools! som åpnes i nytt vindu/tab.
To use an HTML button as a link, you have to add some JavaScript code. JavaScript allows you to specify what happens at certain events, such as a click of a button:
<button onclick="document.location='default.asp'">HTML Tutorial</button>
Click the button to go to the HTML tutorial.
<a href="https://www.w3schools.com/html/" title="Go to W3Schools HTML section">Visit our HTML Tutorial</a>
<a href="default.asp"> <img src="bilder/42x42-stjerne.jpg" alt="" style="width:42px;height:42px;"> </a>
The link will only work if you have email installed.
<p>Dette er en epost-adresse: <a href="mailto:someone@example.com"> Send email</a></p>
mailto:someone@example.com
Dette er en epost-adresse: Send email
Spaces between words should be replaced by %20 to ensure that the browser will display the text properly.
This is an email link: <p><a href= "mailto:someone@example.com?Subject=Hello%20again" target="_top"> Send Mail</a></p>
mailto:someone@example.com?Subject=Hello%20again
This is an email link: Send Mail
<p> This is another mailto link: <a href="mailto:someone@example.com ?cc=someoneelse@example.com &bcc=andsomeoneelse@example.com &subject=Summer%20Party &body=You%20are%20invited%20to%20a%20big%20summer%20party!" target="_top">Send mail!</a> </p>
mailto:someone@example.com
?cc=someoneelse@example.com
&bcc=andsomeoneelse@example.com
&subject=Summer%20Party
&body=You%20are%20invited%20to%20a%20big%20summer%20party!
This is another mailto link: Send mail!
<a href="mailto: someone@yoursite.com"> Email Us</a>
<a href="mailto: someone@yoursite.com ?subject=Mail from Our Site">Email Us</a>
<a href="mailto: someone@yoursite.com ?cc=someoneelse@theirsite.com, another@thatsite.com, me@mysite.com &bcc=lastperson@theirsite.com &subject=Big%20News">Email Us</a>
a.homepage:link, a.homepage:visited { padding: 1px 10px 1px 10px; color: #fff; background: #666; border-radius: 3px; border: 1px outset rgba(50,50,50,.5); font-family: georgia, serif; font-size: 14px; font-style: italic; text-decoration: none; } a.homepage:hover, a.homepage:focus, a.homepage:active { background-color: #333; }
<p>Go to our <a class="homepage" href="https://webplatform.github.io/docs/tutorials/using_selectors/" title="Home page">Home page</a>.</p>
Go to our Home page
a:link {color:teal;} /* unvisited links are this blue-green */ a:visited {color:red;} /* already visited links will be red */ a:hover {color:gold;} /* hover the mouse over a link, it turns gold */ a:active {color:orange;} /* click the link, it turns orange */
a.nav:link {color: blue; text-decoration: none; } a.nav:visited {color: purple; text-decoration: none; } a.nav:hover {color: orange; text-decoration: underline; } a.nav:active {color: red; }
a.external:link {color: #0000ff; font-size: 18pt; font-weight: bold; } a.external:visited {color: #894f7b; font-weight: bold; } a.external:hover {text-decoration: overline; background-color: #003399; } a.external:active {color: red; }
a:link { background-color: coral; } a:visited { background-color: cyan; } a:hover { background-color: DarkMagenta; color:yellow; text-decoration: none; } a:active { background-color: DarkSalmon; }
a:link, a:visited { background-color: #f44336; color: white; padding: 14px 25px; text-align: center; text-decoration: none; display: inline-block; } a:hover, a:active { background-color: red; }
a:link, a:visited { background-color: white; color: black; border: 2px solid green; padding: 10px 20px; text-align: center; text-decoration: none; display: inline-block; } a:hover, a:active { background-color: green; color: white; }
a:link, a:visited { background-color: purple; border: none; color: #FFFFFF; padding: 15px 32px; text-align: center; -webkit-transition-duration: 0.4s; transition-duration: 0.4s; text-decoration: none; font-size: 16px; cursor: pointer; display: inline-block; } a:hover, a:active { background-color: #6D0062; }
PB: Her er det egentlig også en forsinkelse på fargeskiftet.
a:link, a:visited { background-color: DarkSalmon; border: none; color: #FFFFFF; padding: 25px 52px; text-align: center; -webkit-transition-duration: 0.4s; transition-duration: 0.4s; text-decoration: none; font-size: 20px; text-align: center; cursor: pointer; display: inline-block; } a:hover, a:active { background-color: DarkRed; }
PB: Her er det egentlig også en forsinkelse på fargeskiftet.
a:link, a:visited { color: white; background-color: #1ebba3; display: inline-block; padding: 10px 20px; border: 2px solid #099983; text-decoration: none; text-align: center; font: 14px Arial, sans-serif; } a:hover, a:active { background-color: #9c6ae1; border-color: #7443b6; }
a:link, a:visited { background-color: white; color: black; border: 1px solid blue; padding: 30px 30px; text-align: center; text-decoration: none; display: inline-block; } a:hover, a:active { background-color: red; color: white; }
a { background-color: RoyalBlue; color:white; padding:5px 5px; border-radius:5px; text-align: center; text-decoration: none; display: inline-block; } a:hover { background-color: blue; }
...Hvis du vil at alle linkene dine skal være røde kan du skrive følgende CSS-regel.
a {
color: red;
}
Eller du kan skrive den slik.
a:link {
color: red;
}
Begge linjene gir samme resultat. Hvis du ikke trenger å style de andre tilstandene
til linkene dine kan du godt bare ha en regel hvor du dropper :link
men hvis du
først har tenkt til å style alle tilstandene så ser det mer ryddig ut skrive den
tilstanden med :link
.
Standard farge på linker er blå i så og si alle nettlesere. Hvis du vil gjøre om fargen til det samme som resten av teksten kan du lage følgende CSS-regel.
a:link { color: #000; }
Den vil fortsatt skille seg ut ved at den har en strek under seg men den vil nå gå litt mer i ett med teksten. Hvis det er det man ønsker seg. Så kan vi sette den aktive tilstanden til rød og gi den en litt gråaktig farge når den har vært besøkt.
a:active { color: #f00; } a:visited { color: #666; }
På Hover-tilstanden kan vi velge å ta bort understreken istedenfor å endre farge.
Det er selvfølgelig mange andre ting du kan gjøre med linker, men det kan du
eksperimentere med på egenhånd. Sett inn følgende kode på a:hover
.
a:hover { text-decoration: none; }
Legg også merke til at musepekeren forandrer seg nå den kommer over en link.
Dette er også noe vi kan styre med CSS. Den vanlige musepekeren, pilen, kalles
for default. Den musepekeren som kommer opp når den er over en link kalles pointer.
Dette er CSS-regelen som ligger i alle nettlesere som gjør om musepekeren når den
kommer over a
-elementet.
a:hover {
cursor: pointer;
}
Ved å endre den til noe annet enn pointer kan du få mange forskjellige resultater.
.btn { border: 2px solid black; border-radius: 5px; background-color: white; color: black; padding: 14px 28px; font-size: 16px; cursor: pointer; } /* Green */ .success { border-color: #4CAF50; color: green; } .success:hover { background-color: #4CAF50; color: white; } /* Blue */ .info { border-color: #2196F3; color: dodgerblue } .info:hover { background: #2196F3; color: white; } /* Orange */ .warning { border-color: #ff9800; color: orange; } .warning:hover { background: #ff9800; color: white; } /* Red */ .danger { border-color: #f44336; color: red } .danger:hover { background: #f44336; color: white; } /* Gray */ .default { border-color: #e7e7e7; color: black; } .default:hover { background: #e7e7e7; }
<h1>Rounded Outline Buttons</h1> <button class="btn success">Success</button> <button class="btn info">Info</button> <button class="btn warning">Warning</button> <button class="btn danger">Danger</button> <button class="btn default">Default</button>
Use any element to open the dropdown menu, e.g. a <button>, <a> or <p> element.
Use a container element (like <div>) to create the dropdown menu and add the dropdown links inside it.
Wrap a <div> element around the button and the <div> to position the dropdown menu correctly with CSS.
.btn { background-color: #2196F3; color: white; padding: 16px; font-size: 16px; border: none; outline: none; } .dropdown { position: absolute; display: inline-block; } .dropdown-content { display: none; position: absolute; background-color: #f1f1f1; min-width: 160px; z-index: 1; } .dropdown-content a { color: black; padding: 12px 16px; text-decoration: none; display: block; } .dropdown-content a:hover {background-color: #ddd} .dropdown:hover .dropdown-content { display: block; } .btn:hover, .dropdown:hover .btn { background-color: #0b7dda; }
<h2>Split Button Dropdowns</h2>
<p>Move the mouse over the arrow icon to open the dropdown menu.</p>
<button class="btn">Button</button>
<div class="dropdown">
<button class="btn" style="border-left:1px solid #0d8bf2">
<i class="fa fa-caret-down"></i> MANGLER
</button>
<div class="dropdown-content">
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
</div>
#more {display: none;}
<h2>Read More Read Less Button</h2> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum, nisi lorem egestas vitae scel <span id="dots">...</span> <span id="more">erisque enim ligula venenatis dolor. Maecenas nisl est, ultrices nec congue eget, auctor vitae massa. Fusce luctus vestibulum augue ut aliquet. Nunc sagittis dictum nisi, sed ullamcorper ipsum dignissim ac. In at libero sed nunc venenatis imperdiet sed ornare turpis. Donec vitae dui eget tellus gravida venenatis. Integer fringilla congue eros non fermentum. Sed dapibus pulvinar nibh tempor porta.</span></p> <button onclick="myFunction()" id="myBtn">Read more</button> <script> function myFunction() { var dots = document.getElementById("dots"); var moreText = document.getElementById("more"); var btnText = document.getElementById("myBtn"); if (dots.style.display === "none") { dots.style.display = "inline"; btnText.innerHTML = "Read more"; moreText.style.display = "none"; } else { dots.style.display = "none"; btnText.innerHTML = "Read less"; moreText.style.display = "inline"; } } </script>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum, nisi lorem egestas vitae scel ...
a { text-decoration: none; display: inline-block; padding: 8px 16px; } a:hover { background-color: #ddd; color: black; } .previous { background-color: #f1f1f1; color: black; } .next { background-color: #4CAF50; color: white; } .round { border-radius: 50%; }
<a href="#" class="previous">« Previous</a> <a href="#" class="next">Next »</a> <a href="#" class="previous round">‹</a> <a href="#" class="next round">›</a>
En stylet BUTTON til noe helt annet, med HOVER-effekt.
.blockBtn { display: block; width: 100%; border: none; background-color: rgb(19, 0, 105); color: white; padding: 14px 28px; font-size: 36px; cursor: pointer; text-align: center; font-weight: bold; } .blockBtn:hover { background-color: rgb(132, 161, 255); color: black; }
<h2 style="text-align: center;">Block Button Example</h2> <button class="blockBtn">Block Button</button>