Diseña una página web de eventos usando HTML y CSS

La página web de eventos juega un papel vital en la promoción y reserva de un evento. En este artículo, vamos a crear una página de eventos, que contendrá los detalles de los eventos, como la fecha, la opción de reserva y el botón Ver más detalles. Usaremos HTML para dar el diseño básico como título, detalles, botones, etc. y CSS le dará un hermoso diseño a nuestro diseño como decoración de texto, color de texto, color de fondo, alineación de texto, margen, relleno, cuadro flotante, etc.

Acercarse:

  • Primero crearemos dos div para el contenido de la izquierda (contendrá los detalles del evento) y el de la derecha tendrá 3 cuadros que contienen un resumen de los eventos (como la fecha, el botón Ver más, etc.).
  • La sección izquierda que contiene el diseño tiene un encabezado y texto creado con las etiquetas <h1> y <p> . La sección derecha que tiene 3 cuadros contiene: ver más creado usando el botón, tiempo creado usando la etiqueta de intervalo. También contiene un encabezado y un párrafo.
  • En la sección CSS, crearemos un diseño de cuadro usando (tamaño de cuadro) para la sección izquierda y derecha, daremos color de fondo, alineación de texto, decoración de texto y efecto de desplazamiento usando el efecto de transición. También le daremos un color de fondo diferente a los efectos de desplazamiento para

Ejemplo:

HTML

<!DOCTYPE html>
<html lang="en">
  
<head>
    <style>
 
        /* Styling the body */
        body {
            margin: 0;
            padding: 0;
        }
          
        /* Styling section, giving background
            image and dimensions */
        section {
            width: 100%;
            height: 100vh;
            background:
 url('https://media.geeksforgeeks.org/wp-content/uploads/20210408155049/gfg9.png');
            background-size: cover;
        }
          
        /* Styling the left floating section */
        section .leftBox {
            width: 50%;
            height: 100%;
            float: left;
            padding: 50px;
            box-sizing: border-box;
        }
          
        /* Styling the background of
            left floating section */
        section .leftBox .content {
            color: #fff;
            background: rgba(0, 0, 0, 0.5);
            padding: 40px;
            transition: .5s;
        }
          
        /* Styling the hover effect 
            of left floating section */
        section .leftBox .content:hover {
            background: #e91e63;
        }
          
        /* Styling the header of left
            floating section */
        section .leftBox .content h1 {
            margin: 0;
            padding: 0;
            font-size: 50px;
            text-transform: uppercase;
        }
          
        /* Styling the paragraph of
            left floating section */
        section .leftBox .content p {
            margin: 10px 0 0;
            padding: 0;
        }
          
        /* Styling the three events section */
        section .events {
            position: relative;
            width: 50%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            float: right;
            box-sizing: border-box;
        }
          
        /* Styling the links of
        the events section */
        section .events ul {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            margin: 0;
            padding: 40px;
            box-sizing: border-box;
        }
          
        /* Styling the lists of the event section */
        section .events ul li {
            list-style: none;
            background: #fff;
            box-sizing: border-box;
            height: 200px;
            margin: 15px 0;
        }
          
        /* Styling the time class of events section */
        section .events ul li .time {
            position: relative;
            padding: 20px;
            background: #262626;
            box-sizing: border-box;
            width: 30%;
            height: 100%;
            float: left;
            text-align: center;
            transition: .5s;
        }
          
        /* Styling the hover effect
            of events section */
        section .events ul li:hover .time {
            background: #e91e63;
        }
          
        /* Styling the header of time
            class of events section */
        section .events ul li .time h2 {
            position: absolute;
            margin: 0;
            padding: 0;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: #fff;
            font-size: 60px;
            line-height: 30px;
        }
          
        /* Styling the texts of time
        class of events section */
        section .events ul li .time h2 span {
            font-size: 30px;
        }
          
        /* Styling the details
        class of events section */
        section .events ul li .details {
            padding: 20px;
            background: #fff;
            box-sizing: border-box;
            width: 70%;
            height: 100%;
            float: left;
        }
          
        /* Styling the header of the
        details class of events section */
        section .events ul li .details h3 {
            position: relative;
            margin: 0;
            padding: 0;
            font-size: 22px;
        }
          
        /* Styling the lists of details
        class of events section */
        section .events ul li .details p {
            position: relative;
            margin: 10px 0 0;
            padding: 0;
            font-size: 16px;
        }
          
        /* Styling the links of details
        class of events section */
        section .events ul li .details a {
            display: inline-block;
            text-decoration: none;
            padding: 10px 15px;
            border: 1.5px solid #262626;
            margin-top: 8px;
            font-size: 18px;
            transition: .5s;
        }
          
        /* Styling the details class's hover effect */
        section .events ul li .details a:hover {
            background: #e91e63;
            color: #fff;
            border-color: #e91e63;
        }
    </style>
</head>
  
<body>
    <section>
        <div class="leftBox">
            <div class="content">
                <h1>
                    Events and Shows
                </h1>
                 
<p>
                    With the idea of imparting programming
                    knowledge, Mr. Sandeep Jain, an IIT
                    Roorkee alumnus started a dream,
                    GeeksforGeeks. Whether programming
                    excites you or you feel stifled,
                    wondering how to prepare for
                    interview questions or
                    how to ace data structures and
                    algorithms, GeeksforGeeks is a
                    one-stop solution. With every
                    tick of time, we are adding arrows
                    in our quiver. From articles on
                    various computer science subjects
                    to programming problems for practice,
                    from basic to premium courses, from
                    technologies to entrance examinations,
                    we have been building ample content
                    with superior quality. In a short
                    span, we have built a community of
                    1 Million+ Geeks around the world, 20,000+
                    Contributors and 500+ Campus Ambassadors
                    in various colleges across the nation.
                    Our success stories include a lot of
                    students who benefitted in their
                    placements and landed jobs at tech
                    giants. Our vision is to build a gigantic
                    network of geeks and we are only a
                    fraction of it yet.
                </p>
 
            </div>
        </div>
  
        <div class="events">
            <ul>
                <li>
                    <div class="time">
                        <h2>
                            15 <br><span>March</span>
                        </h2>
                    </div>
                    <div class="details">
                        <h3>
                            Where is the event happening?
                        </h3>
                         
<p>
                            With the idea of imparting programming
                            knowledge, Mr. Sandeep Jain, an IIT
                            Roorkee alumnus started a dream,
                            GeeksforGeeks. Whether programming
                            excites you or you feel stifled,
                            how to ace data structures and
                            algorithms, GeeksforGeeks is a
                            one-stop solution.
                        </p>
 
  
                        <a href="#">View Details</a>
                    </div>
                    <div style="clear: both;"></div>
                </li>
  
                <li>
                    <div class="time">
                        <h2>
                            27 <br><span>May</span>
                        </h2>
                    </div>
                    <div class="details">
                        <h3>
                            Where is the event happening?
                        </h3>
                         
<p>
                            With the idea of imparting programming
                            knowledge, Mr. Sandeep Jain, an IIT
                            Roorkee alumnus started a dream,
                            GeeksforGeeks. Whether programming
                            excites you or you feel stifled,
                            how to ace data structures and
                            algorithms, GeeksforGeeks is a
                            one-stop solution.
                        </p>
 
                        <a href="#">View Details</a>
                    </div>
                    <div style="clear:both;"></div>
                </li>
  
                <li>
                    <div class="time">
                        <h2>
                            12 <br><span>August</span>
                        </h2>
                    </div>
                    <div class="details">
                        <h3>
                            Where is the event happening?
                        </h3>
                         
<p>
                            With the idea of imparting programming
                            knowledge, Mr. Sandeep Jain, an IIT
                            Roorkee alumnus started a dream,
                            GeeksforGeeks. Whether programming
                            excites you or you feel stifled,
                            how to ace data structures and
                            algorithms, GeeksforGeeks is a
                            one-stop solution.
                        </p>
 
  
                        <a href="#">View Details</a>
                    </div>
                    <div style="clear:both;"></div>
                </li>
            </ul>
        </div>
    </section>
</body>
  
</html>

Producción:

Publicación traducida automáticamente

Artículo escrito por imsushant12 y traducido por Barcelona Geeks. The original can be accessed here. Licence: CCBY-SA

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *