This doesn't have to do anything relating to make it a ticker related component, I've already done that already. I just wanted to polish the way it looked by adding a slash "/" contrast between the two colors. I want to avoid adding a separate div
component just for the slash. I've added a picture of the example here (sorry to the colorblind people, it's probably difficult to tell):
tl;dr Basically, how do I add that slash (circled in red) without using a div
box reserved for the slash?
Here's my current code:
.tickerv-wrap {
background: #eee;
box-sizing: content-box;
height: 19px;
/* container that only displays this height... correlate with tickerv-wrap ul li line-height, was 1px smaller than tickerv-wrap ul li line-height */
overflow: hidden;
/* Hide scrollbars */
padding: 1px;
/* watch for this as well... best to put as line-height - height */
}
/* TICKER ANIMATION */
@keyframes tickerv {
0% {
margin-top: 0;
}
/* Quite literally -ve height of wrapper */
25% {
margin-top: -19px;
}
/* 1 X tickerv-wrap height */
50% {
margin-top: -38px;
}
/* 2 X tickerv-wrap height px */
75% {
margin-top: -57px;
}
/* 3 X tickerv-wrap height px */
100% {
margin-top: 0;
}
/* Back to first line */
}
.tickerv-wrap ul {
padding: 0;
margin: 0;
list-style-type: none;
animation-name: tickerv;
/* Loop through items */
animation-duration: 7s;
animation-iteration-count: infinite;
animation-timing-function: cubic-bezier(1, 0, .5, 0);
}
.tickerv-wrap ul:hover {
/* Pause on mouse hover */
animation-play-state: paused;
}
/* ITEMS */
.tickerv-wrap ul li {
font-size: 18px;
line-height: 20px/* Same as wrapper height */
}
<!Doctype HTML>
<html>
<head>
<title>Vertical News Ticker</title>
<link rel="stylesheet" href="newsTicker.css">
</head>
<body>
<div class="tickerv-wrap">
<ul>
<li>Title 1</li>
<li>Title 2</li>
<li>Title 3</li>
<li>Title 4</li>
</ul>
</div>
</body>
</html>