Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the document</title> <style> #example { display: block; background-color: lightblue; padding: 10px; } .text { display: inline-block; padding: 10px 20px; background-color: lightgreen; } .right-text { display: block; text-align: right; background-color: pink; padding: 5px 10px; } </style> </head> <body> <span id="example"> <span class="text">This is a span element.</span> <span class="right-text">This is an another span element</span> </span> </body> </html>