
Originally Posted by
coothead
I found that "float" seemed to be the simple solution.
I would prefer to do away with the float because that requires clearing it for subsequent text. Why not use direction: rtl; for #holas, then direction: ltr; and display: inline-block; for #holas span?
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-color: #f9f9f9;
font: 100% / 162% verdana, arial, helvetica, sans-serif;
}
#holas {
text-align: center;
direction: rtl;
}
#holas span {
background-color: #ffc0cb;
display: inline-block;
direction: ltr;
}
</style>
</head>
<body>
<div id="holas" >
<span>Hola 1!</span>
<span>Hola 2!</span>
<span>Hola 3!</span>
</div>
</body>
</html>
Bookmarks