Hi there theremotedr
the code that I gave you was specific for the text length.
If you are going to use multiple marquees then each will need individual coding.
Here is an example...
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1">
<title>untitled document</title>
<!--<link rel="stylesheet" href="screen.css" media="screen">-->
<style media="screen">
body {
background-image: url(http://theremotedoctor.co.uk/m-images/background.png);
font: 1em/150% arial, helvetica, sans-serif;
}
.marquee {
height: 2.5em;
border-radius: 1em;
border: 1px solid #5d0e13;
box-shadow: 0.25em 0.25em 0.5em #000;
overflow: hidden;
background-color: #66c2f1;
}
.marquee p {
line-height: 3.5em;
margin: 0;
font-size: 0.8em;
font-weight: bold;
white-space: nowrap;
animation: 12s linear infinite;
background-color: red; /* this is only for testing and should be removed */
}
#marq-1 {
width: 33em;
animation-name: marquee-1;
}
#marq-2 {
width: 45em;
animation-name: marquee-2;
}
#marq-3 {
width: 18em;
animation-name: marquee-3;
}
@keyframes marquee-1 {
0% {margin-left: 100%;}
100% {margin-left: -33em;}
}
@keyframes marquee-2 {
0% {margin-left: 100%;}
100% {margin-left: -45em;}
}
@keyframes marquee-3 {
0% {margin-left: 100%;}
100% {margin-left: -18em;}
}
</style>
</head>
<body>
<div class="marquee">
<p id="marq-1">CONTACT ME ON IPBR21054, I ALSO USE WHATSAPP 07899827427.</p>
</div>
<div class="marquee">
<p id="marq-2">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur sit amet sem sed libero.</p>
</div>
<div class="marquee">
<p id="marq-3"><a href="http://www.theremotedoctor.co.uk/">http://www.theremotedoctor.co.uk/</a></p>
</div>
</body>
</html>
I use the
"em unit" when coding.
To get the length of the text in this unit requires this calculation...
length of text in pixels divided by (16 multiplied by the font size)
I hope that this helps.
coothead
Bookmarks