DEV Community


Today I learned about Image elements

ahtshamajus profile image Ahtsham Ajus ・1 min read

Here,s My HTML code,

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="./normalize.css" />
    <link rel="stylesheet" href="./style.css" />
    <link rel="preconnect" href="" />
    <section class="products">
      <h1>Hubble space telescope</h1>
      <p class="paraghraph">30 Years of Discovery</p>
Enter fullscreen mode Exit fullscreen mode

Here,s My CSS code,

html {
  font-size: 62.5%;
body {
  font-family: Poppins, Arial, Helvetica, sans-serif;
h1 {
  font-weight: 900;
  font-size: 8rem;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #000;
  word-spacing: 1.5rem;
.products {
  background: url(./jeremy-thomas-E0AHdsENmDg-unsplash\ .jpg) no-repeat;
  background-size: cover;

.products {
  align-items: center;
  background: url(./jeremy-thomas-E0AHdsENmDg-unsplash\ .jpg);
  background-size: cover;
  color: #fff;
  display: flex;
  flex-direction: column;
  height: 100vh;
  justify-content: center;
  padding: 1rem;
  text-align: center;
.products .paraghraph {
  background: rgba(0, 0, 0, 0.6);
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: 1.5px;
  padding: 1.5rem;

Enter fullscreen mode Exit fullscreen mode

Here's the output

Alt Text

Discussion (0)

Editor guide