HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URL's added here will be added as <link>
s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
If the stylesheet you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>my hosiopital</title>
<link rel="stylesheet" href="./css/style.css">
<meta name="author" content="timoty code">
</head>
<body>
<header id="main-header">
<nav id="navbar">
<ul>
<li><a href="">home</a></li>
<li><a href="">pateint care</a></li>
<li><a href="">find a doctor</a></li>
<li><a href="">appoinment</a></li>
<li><a href="">about us</a></li>
<li><a href="">contact us</a></li>
</ul>
</nav>
<div class="showcase">
<h3>Ward admissions</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing atus eaque<br> elit. Nihil illo, nostrum aliquam unde.<br> Aperiam corporis porro doloratus eaque<br> temporibus tempora quam <br>voluptates blanditiis tempore,<br> itaque officiis ipsa.</p>
<a href="#" class="btn">Read More</a>
</div>
</header>
<section id="services">
<div>
<div class="box-1">
<h1>Appoinment</h1>
</div>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Vel, itaque architecto! Dolor incidunt ut recusandae consequatur soluta adipisci magni natus!</p>
<a href="#">Learn More</a>
</div>
<div>
<div class="box-2">
<h1>Our Services</h1>
</div>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Vel, itaque architecto! Dolor incidunt ut recusandae consequatur soluta adipisci magni natus!</p>
<a href="#">Learn More</a>
</div>
<div>
<div class="box-3">
<h1>about us</h1>
</div>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Vel, itaque architecto! Dolor incidunt ut recusandae consequatur soluta adipisci magni natus!</p>
<a href="#">Learn More</a>
</div>
</section>
<section id="news">
<div class="news-1">
</div>
<div>
<div class="news-2">
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Fugiat voluptate provident molestias pariatur amet blanditiis illum, excepturi aliquam expedita dolor inventore, esse recusandae! Provident, maiores laudantium eum repellat impedit recusandae est optio ex odit reprehenderit cum consequatur aliquid dicta quis quod nam! Odit non accusantium impedit blanditiis optio obcaecati!</p>
</div>
</section>
<section id="newsletter">
<div>
<h3>The best of My Hospital, right in your inbox.</h3>
<p>Sign up for our email newsletter</p>
</div>
<form action="tim03874@gmail.com">
<input type="text" placeholder="Email Adress*" name="email">
<input type="submit" value="subscribe">
</form>
</section>
<section id="quicklinks">
<ul>
<h3>quick links</h3>
<li><a href="#">home</a></li>
<li><a href="#">services</a></li>
<li><a href="#">about</a></li>
<li><a href="#">contact</a></li>
</ul>
<ul>
<h3>follow us</h3>
<li><a href="">facebook</a></li>
<li><a href="">twitter</a></li>
<li><a href="">instagram</a></li>
</ul>
<ul>
<h3>contact us</h3>
<li>My Hospital Mbale</li>
<li>P.O Box 1147 </li>
<li>045 4431230 </li>
<li>info@myhosipital.com</li>
</ul>
</section>
<footer id="main-footer">
<p>copyright © all rightt reserverd</p>
<p>powerered by <a href="http://www.twitter.com/weptim">weptim</a></p>
</footer>
</body>
</html>
/*global staff*/
* {
margin:0;
padding:0;
}
body {
background:#fff;
font-size:1em;
font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height:1.5;
color:#333;
}
.btn {
background-color:green;
color:#fff;
padding:.5em 1em;
margin-left:1em;
border-radius:10px;
}
ul {
list-style-type:none;
padding:none;
margin:none;
}
img {
width:100%;
}
a {
color:#eee;
text-transform:uppercase;
text-decoration:none;
}
/* global staff end */
#main-header {
background:linear-gradient(rgba(0,0,0,0.3),rgba(0,0,0,0.3)), url('https://images.pexels.com/photos/1250655/pexels-photo-1250655.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940');
background-position:center;
background-size:cover;
height:90vh;
width:100%;
}
a {
color:#222;
}
#main-header #navbar {
border-bottom: 1px solid darkgrey;
padding:2em;
}
#main-header nav ul {
display:flex;
justify-content:space-around;
font-size:0.89em;
}
#main-header ul li a {
color:#fff;
font-weight:bold;
}
#main-header ul li a:hover {
color:orange;
}
#main-header .showcase {
display: flex;
flex-direction: column;
align-items: flex-start;
}
#main-header .showcase h3 {
color:orange;
text-transform:capitalize;
font-size:2em;
height:100px;
margin:1em;
position: relative;
top:-50px;
animation-name: showcase-h3;
animation-duration: 3s;
animation-fill-mode:forwards;
}
@keyframes showcase-h3 {
0% {top:-50px}
100% {top:100px}
}
#main-header .showcase p {
margin:1em;
color:#eee;
position: relative;
left:-1200px;
animation-name: showcase-p;
animation-duration: 3s;
animation-fill-mode:forwards;
}
@keyframes showcase-p {
0% {left:-1200px}
100% {left:0px}
}
#main-header .showcase .btn {
opacity: 0;
animation-name: showcase-btn;
animation-duration: 3s;
animation-delay:3s;
animation-fill-mode:forwards;
}
@keyframes showcase-btn {
0% {opacity:0}
100% {opacity:1}
}
#main-header .showcase .btn:hover {
background:orange;
}
/* main-header */
/* services */
#services {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-gap:1em;
margin:3em;
text-align:center;
padding-bottom:2em;
}
#services h1 {
font-size:3em;
}
#services a {
color:#333;
text-transform:lowercase;
font-size:0.89em;
border-bottom: 1px solid lightgrey;
}
#services div {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
#services p {
padding:1em 0;
}
.box-1 {
background:linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0.5)), url(https://images.pexels.com/photos/33258/blood-pressure-pressure-gauge-medical-the-test.jpg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940);
background-size:cover;
background-position:center;
height:200px;
display:flex;
flex-direction:column;
justify-content:center;
align-content: center;
align-items:center;
}
.box-1 h1 {
color:orange;
}
.box-2 {
background:url(https://images.pexels.com/photos/40559/medic-hospital-laboratory-medical-40559.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940);
background-size:cover;
background-position:center;
height:200px;
display:flex;
flex-direction:column;
justify-content:center;
align-content: center;
align-items:center;
}
.box-3 {
background:url(https://images.pexels.com/photos/355934/pexels-photo-355934.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940);
background-size:cover;
background-position:center;
height:200px;
display:flex;
flex-direction:column;
justify-content:center;
align-content: center;
align-items:center;
}
#news {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
display:grid;
grid-template-columns: 2fr 1fr;
}
.news-1 {
background:url('https://images.pexels.com/photos/263210/pexels-photo-263210.jpeg?auto=compress&cs=tinysrgb&h=650&w=940" alt="brain damage diagonistics');
background-position:center;
background-size:cover;
height:400px;
}
.news-2 {
height:400px;
text-align:center;
padding:1em;
display:flex;
flex-direction:column;
justify-content:center;
align-content: center;
align-items:center;
}
/* news*/
#newsletter {
display:flex;
justify-content:space-around;
padding:3em;
margin:2em 0 0 0;
background-color:rgb(79, 139, 189);
overflow: hidden;
}
#newsletter form input[type="text"] {
width:300px;
margin-right:1em;
padding:0.89em;
text-align:center;
border:none;
background:rgb(79, 139, 189);
color:#fff;
border-bottom:solid 1px #eee;
}
#newsletter form input[type="text"]:focus {
outline:none;
}
#newsletter form input[type="submit"] {
padding:0.7em;
background:#333;
border:none;
color:#fff;
text-transform:uppercase;
}
/* newsletter */
#quicklinks {
padding:5em;
text-align:center;
background: url('https://images.pexels.com/photos/255379/pexels-photo-255379.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940');
background-position:center;
background-size:cover;
grid-gap:1em;
display:grid;
grid-template-columns: 1fr 1fr 1fr;
}
/* footer */
#main-footer {
text-align:center;
background: rgb(4, 45, 78);
color:#eee;
font-size:0.89em;
padding:1em;
}
@media (max-width:500px) {
#main-header nav ul {
display:grid;
grid-gap:0.5em;
grid-template-columns: 1fr;
}
#main-header nav ul li a {
display:block;
width:100%;
background: #333;
font-size:0.9em;
text-align:center;
}
#main-header .showcase h3 {
font-size:1em;
}
#main-header .showcase .btn {
display:none;
}
#services {
grid-template-columns: 1fr;
text-align:center;
margin:0;
}
#services h1 {
font-size:1.5em;
}
.box-1 {
flex-wrap:wrap;
}
#news {
grid-template-columns: 1fr;
}
#quicklinks {
grid-template-columns: 1fr;
}
#newsletter {
flex-wrap: wrap;
text-align:center;
}
}
Also see: Tab Triggers