I am trying to write the paragraph in the color red, but I am not getting the result i expected, can someone help me?
<h1> OluwaTomyin Giwa is an awesome guy. </h1>
<br>
<p color="red" no shade> OluwaTomiyin was born in Nigeria in the year 1984, to the parents of John and Olufunto Giwa. </p>
Use style.
<h1> OluwaTomyin Giwa is an awesome guy. </h1>
<br>
<p style="color:red;" no shade> OluwaTomiyin was born in Nigeria in the year 1984, to the parents of John and Olufunto Giwa. </p>
You should write it as
<p> <span style="color:red;"> Your Text</span</p>
<p> tag don't have color attribute
Use inline CSS to do so...
<h1> OluwaTomyin Giwa is an awesome guy. </h1>
<br>
<p style="color:red;" no shade> OluwaTomiyin was born in Nigeria in the year 1984, to the parents of John and Olufunto Giwa. </p>
Or you can use internal CSS
<html>
<head>
<style>
.red {
color:red;
}
</style>
</head>
<body>
<h1> OluwaTomyin Giwa is an awesome guy. </h1>
<br>
<p class="red" no shade> OluwaTomiyin was born in Nigeria in the year 1984, to the parents of John and Olufunto Giwa. </p>
</body>
</html>
Related
How browser shows "my" code
<html>
<head>
<title> chatter|app </title>
<style>
.styled_dates {
font-size: 11px;
}
</style>
</head>>
<body>
<h1> chatter|app </h1>
<h2> Favorites </h2>
<p> <strong>Neversea</strong> <p class="styled_dates"> 11/07/2022 </p>
<p> <strong>Deutschland</strong> <p class="styled_dates"> 23/05/2019 </p>
<p> <strong>Erasmus</strong> <p class="styled_dates"> 23/06/1999 </p>
<p> <strong>Work</strong> <p class="styled_dates"> 04/07/2003 </p>
<h2> Regular </h2>>
</body>
</html>
Hello. Noobie here.
What I want to do: see the dates next to "Neversea, Deutschland, Erasmus, Work", not underneath them.
Neversea 11 07/2022
not...
Neversea
11/07/2022
How can I do that?
Thank you
The issue is that <p> tags by default follow onto the next line. Also you have unclosed tags (each line you open 2 and only close 1)
In my code I use <span> elements, they are made for in-line styling/changes which seems appropriate for your use case.
.styled_dates {
font-size: 11px;
}
<h1> chatter|app </h1>
<h2> Favorites </h2>
<p>
<strong>Neversea</strong>
<span class="styled_dates">11/07/2022</span>
</p>
<p>
<strong>Deutschland</strong>
<span class="styled_dates">23/05/2019</span>
</p>
<p>
<strong>Erasmus</strong>
<span class="styled_dates">23/06/1999</span>
</p>
<p>
<strong>Work</strong>
<span class="styled_dates">04/07/2003</span>
</p>
<h2> Regular </h2>
I'm learning HTML online through my community college and is hard.
"In this assignment you will create an HTML document that includes the div element to showcase your favorite movie. You will include the movie title, the year the movie was released, the main star or stars and their character(s) name. The div element will render on the right side of the page. See below for an example of what your .html should look like.
this is my code so far. I need some guidance on who to accomplish shifting the text with the border to the right without CSS
<div align="right" style="border: 1px solid black" hj>
<h1><span>Inception</span></h1>
<h2><span> Release year: 2010 </span></h2>
<h3><span> Leonardo DiCaprio as Dom Cobb </span></h3>
</div>
<h2> My Three Favorite musical acts are: </h2>
<ul>
<li>Korn</li>
<li>Bring Me the Horizon </li>
<li> Linkin Park </li>
</ul>
<h2> My Three Favorite Foods are: </h2>
<ol type="i">
<li>Pizza</li>
<li>Ceviche</li>
<li>Burger</li>
</ol>
<h2> My dream Vacation is: </h2>
<p> Europe </p>
<dl> My dream vacation would be to visit europe and it's major cities. Paria, London, Berlin just to name a few. </dl>
It seems to work like this.
I also improved your <dl> element, which was not correctly written, by adding the <dt> and <dd> tags inside.
Cheers
<!DOCTYPE html>
<html>
<head>
<title>Page title</title>
</head>
<body>
<div style="border: 1px solid black;float:right;width:300px;padding:10px;">
<h1><span>Inception</span></h1>
<h2><span> Release year: 2010 </span></h2>
<h3><span> Leonardo DiCaprio as Dom Cobb </span></h3>
</div>
<div style="float:left;margin-left: 10px;">
<h2> My Three Favorite musical acts are: </h2>
<ul>
<li>Korn</li>
<li>Bring Me the Horizon </li>
<li> Linkin Park </li>
</ul>
<h2> My Three Favorite Foods are: </h2>
<ol type="i">
<li>Pizza</li>
<li>Ceviche</li>
<li>Burger</li>
</ol>
<h2> My dream Vacation is: </h2>
<dl>
<dt>Europe</dt>
<dd>My dream vacation would be to visit europe and it's major cities. Paria, London, Berlin just to name a few.</dd>
</dl>
</div>
</body>
</html>
try this :
<div align="right" style="border: 1px solid black;float:right;width:300px" hj>
<h1><span>Inception</span></h1>
<h2><span> Release year: 2010 </span></h2>
<h3><span> Leonardo DiCaprio as Dom Cobb </span></h3>
</div>
<div style=" float:left;">
<h2> My Three Favorite musical acts are: </h2>
<ul>
<li>Korn</li>
<li>Bring Me the Horizon </li>
<li> Linkin Park </li>
</ul>
<h2> My Three Favorite Foods are: </h2>
<ol type="i">
<li>Pizza</li>
<li>Ceviche</li>
<li>Burger</li>
</ol>
</div>
<h2> My dream Vacation is: </h2>
<p> Europe </p>
<dl> My dream vacation would be to visit europe and it's major cities. Paria, London,
Berlin just to name a few. </dl>
I'm trying to re-format an EPUB using the PDF format of the same book as a model using Calibre. I found this: https://i.stack.imgur.com/tGPWt.jpg
I want to: Make the text on the right look the same as the one on the left.
The EPUB is like this:
Code:
.calibre {
display: block;
font-size: 1em;
padding-left: 0;
padding-right: 0;
margin: 0 5pt;
}
.p2 {
text-indent: 1.5em;
margin: 0;
}
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<body class="calibre">
<p class="p2">It was hard to not watch his Status Page like a hawk (which apparently lived in the mountain areas), but he watched his level slowly rise over the course of the cycle. </p>
<p class="p2">Level 19.02 – A Red Wolf.</p>
<p class="p2">Level 19.08 – Three more Red Wolves.</p>
<p class="p2">Level 19.13 – Some Psycho Killer Bees guarding a Blue Chest with a <i class="calibre3">Pretty Rock</i> in it.</p>
<p class="p2">Level 19.22 – An Undead Swordsman and his Skelemaidens. </p>
<p class="p2">Level 19.29 – A pack of Fish Otters. </p>
<p class="p2">Level 19.38 – A very angry-looking Stump. </p>
<p class="p2">Level 19.45 – Three more Red Wolves. </p>
<p class="p2">Level 19.57 – Some Psycho Killer Bees guarding a Blue Chest with a <i class="calibre3">Pretty Rock</i> in it. (He had gotten turned around at some point and had ended up going in a circle.)</p>
<p class="p2">Level 19.66 – A trip back to kill some Heat Pigs in the Salazarm Desert for more <i>Desert Bacon. </i></p>
</body>
</html>
I just want to change the part after the " - ". On the PDF, it doesn't continue under 'level 19.XX'. If I try to change the text-align using span or something similar it doesn't work. I don't know what to do anymore.
I hope I managed to explain it well. Any ideas?
EDIT: I'll expand the code to what it looks like:
you need to follow this html structure to get this...
I wrapped line with div status-container and then divide label and text separately
I find this solution from here
.status-label {
float:left; padding-right:5px;
}
.status-text {
overflow:hidden; display:block;
}
.p2 {
margin: 0;
}
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<body class="calibre">
<p class="p2">It was hard to not watch his Status Page like a hawk (which apparently lived in the mountain areas), but he watched his level slowly rise over the course of the cycle. </p>
<div class="status-container">
<p class="p2"><span class="status-label">Level 19.02 – </span><span class="status-text">A Red Wolf.</span></p>
</div>
<div class="status-container">
<p class="p2"><span class="status-label">Level 19.08 – </span> <span class="status-text">Three more Red Wolves.</span></p>
</div>
<div class="status-container">
<p class="p2"><span class="status-label">Level 19.13 – </span> <span class="status-text">Some Psycho Killer Bees guarding a Blue Chest with a <i class="calibre3">Pretty Rock</i> in it.</span></p>
</div>
<div class="status-container">
<p class="p2"><span class="status-label">Level 19.22 – </span><span class="status-text"> An Undead Swordsman and his Skelemaidens. </span></p>
</div>
<div class="status-container">
<p class="p2"><span class="status-label">Level 19.29 – </span><span class="status-text"> A pack of Fish Otters. </span></p>
</div>
<div class="status-container">
<p class="p2"><span class="status-label">Level 19.38 – </span><span class="status-text"> A very angry-looking Stump. </span></p>
</div>
<div class="status-container">
<p class="p2"><span class="status-label">Level 19.45 – </span><span class="status-text">Three more Red Wolves. </span></p>
</div>
<div class="status-container">
<p class="p2"><span class="status-label">Level 19.57 – </span> <span class="status-text">Some Psycho Killer Bees guarding a Blue Chest with a <i class="calibre3">Pretty Rock</i> in it. (He had gotten turned around at some point and had ended up going in a circle.)</span></p>
</div>
<div class="status-container">
<p class="p2"><span class="status-label">Level 19.66 – </span> <span class="status-text">A trip back to kill some Heat Pigs in the Salazarm Desert for more <i>Desert Bacon. </i></span></p>
</div>
</body>
</html>
My daughter is in the process of learning HTML/CSS and have been going through the examples in: Head First HTML and CSS One of the first examples instructs the reader to insert the following:
<html>
<head>
<title> Starbuzz Coffee </title>
<style type='text/css'>
body {
background-color: #d2b48c;
margin-left: 20%;
margin-right: 20%;
border: 2px dotted black;
padding: 10px 10px 10px 10px;
font-family: sans-serif;
}
</style>
</head>
<body>
<h1> Starbuzz Coffee Beverages </h1>
<h2> House Blend, $1.49 </h2>
<p> A smooth, mild blend of coffees from Mexico, Bolivia and Guatemala.</p>
<h2> Mocha Cafe Latte, $2.35 </h2>
<p> Espresso, steamed milk and chocolate syrup. </p>
<h2> Cappuccino, $1.89 </h2>
<p> A mixture of espresso, steamed milk and foam.</p>
<h2> Chai Tea, $1.85 </h2>
<p> A spicy drink made with black tea, spices, milk and honey. </p>
</body>
</html>
The HTML renders just fine, but the CSS appears to have been ignored and does not appear when one asks to see the code underlying the page. Ideas about what is missing? It is difficult to make it through a book if stumbling at the gate.
I can't get these to move to the center of the page. Anyone see what's wrong?
<ul id="contact">
<h1> Contact </h1>
<p> Dreamstowheels#yahoo.com </p>
<p> 2236 El Camino Real <br>
Santa Clara Ca 95050 </p>
</ul>
<ul id="follow">
<h1> Follow </h1>
<img src="http://www.flagera.eu/sites/all/modules/socialmedia/icons/levelten/glossy/32x32/facebook.png">
</ul>
<ul id="supporters">
<h1> Supporters </h1>
<p> Cyclinginquisition.com </p>
<p> Colombia Cycling Team </p>
<p> Calmar Bicycles </p>
<p> Rock Solid Cycling </p>
<p> Fast Freddie Foundation </p>
<p> Golden Creek Services (Envio de Paquetes) </p>
</ul>
</footer>
CSS
footer{ /*Footer section attributes */
margin: -50px auto;
width: 100%;
text-align: center;
/* border-top: solid 1px;*/
}
Let me know if you need to css for the contact, follow, and supporters divs. Thanks in advance.
Erase everything in your CSS code in fiddle and just put the following there.
footer{ margin:0 auto; text-align:center;}
https://jsfiddle.net/u2Zb2/45/