I'm interested in becoming a member of a dynamic <section> paired with a <p> tag

Having trouble connecting my <section> and the <p> beneath it. Below is the HTML and CSS code in question:

#projects {
  background: linear-gradient(#5db7de, #4e9bbb);
  flex-direction: column;
  align-items: center;
  display: flex;
}

img {
  width: 500px;
  height: 500px;
  object-fit: cover;
  border-radius: 10px;
}

.project-tile {
  font-size: 40px;
  font-weight: bold;
  background-color: #113f53;
  width: 500px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
}

#project-1 {
  padding-top: 30px;
}
<div id="projects">
  <h3 id="intro-projects">These are my Responsive Web Projects</h3>
  <br />
  <section class="project-img" id="project-1">
    <a href="https://survey-form.freecodecamp.rocks" target="_blank">
      <img src="https://cdn.freecodecamp.org/testable-projects-fcc/images/survey-form-background.jpeg" />
    </a>
  </section>
  <p class="project-tile">SURVEY FORM</p>
  <div id="space_bottom"></div>
</div>

My objective:

The separation between my image text and pictures needs to be fixed to match the layout shown in the "Objective" section.

Answer №1

To address this problem, try setting margin-top: 0 for the .project-tile class and adding display: block to the img element.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to adjust the height of a dropdown box in an angular application?

Is there a way to change the height of the scroll view? It seems too long for my liking, any advice? I attempted to adjust it using css but unfortunately, it didn't work out. The scroll view appears excessively lengthy as shown in the image below. h ...

Exploring the Dynamic Content Security Policy for connect-src in Angular

In my Angular project, I specified the Content Security Policy (CSP) in the meta tags of the index.html file. <meta http-equiv="Content-Security-Policy" content="default-src 'self'; connect-src 'self' https://baseur ...

Transform text that represents a numerical value in any base into an actual number

Looking to convert a base36 string back to a double value. The original double is 0.3128540377812142. When converting it to base 36: (0.3128540377812142).toString(36); The results are : Chrome: 0.b9ginb6s73gd1bfel7npv0wwmi Firefox: 0.b9ginb6s73e Now, h ...

Displaying PHP Code for Webpage Login System

Looking for some assistance with my PHP login system. After hours of testing, I've encountered an issue where all code from ($errors as $error) is displaying on the webpage instead of functioning properly. I noticed that changing > to < in if(c ...

Is it possible that CSS is causing the links to be unclickable?

I'm experiencing an issue where the links in my navigation bar are unclickable unless I remove some of the CSS styling I added. Here is the specific CSS snippet that needs to be removed for the links to work: .main-nav { float: right; list-style ...

Facing issues with integrating json data into html through svelte components

Just starting out with svelte and taking on a project for my internship. I have my local json file and I'm struggling to integrate it into my HTML. I've been scouring the internet but haven't found a solution yet. This is what I've tr ...

``Unusual padding for the body in VueJS and Nuxt, with a touch of CSS

I am currently working with VueJS + NuxtJS and have implemented a background gif. Right now, the code looks like this: body { margin: 0 auto; background: url("assets/video/background-darked.gif") no-repeat center center fixed; -webkit-backg ...

Shifting image position in Bootstrap row

Is there a way to align a picture with a sign 1 to the top of a red field using bootstrap without messing up the layout when changing the page size? https://i.sstatic.net/g86Pq.jpg <div class="container"> <div class="row p ...

How to create a heading within a Bootstrap list item?

Attempting to replicate this layout using Bootstrap 3 This is my current progress <ul class="list-group"> <li class="list-group-item> Cras justo odio </li> <li class="list-group-item> Dapibus ac facilisis in </l ...

avoiding the need to download additional audio files when the play() function is executed

I have encountered a strange issue with my audio files. When I trigger the function 'setCurTime37()', it plays the correct audio file ('myAudios1') as expected. However, it also initiates the downloading of the second audio file (' ...

Tips for keeping your container from expanding due to a bootstrap table

Check out this Codepen example for reference: https://codepen.io/anthonyhvelazquez/pen/oNjPrgQ <nav class="navbar navbar-expand-lg navbar-light bg-light"> <a class="navbar-brand" href="#">Navbar</a> <button class="navbar-toggler" ...

Verify the compatibility of a mobile browser with CSS and javascript functionality

Currently working on a mobile site project where I plan to create two versions - one with a heavy focus on JavaScript and CSS, and another more basic version using simple XHTML for older phones. Is there a way to automatically redirect users based on thei ...

Exploring how to extract table data using XPath in PHP through continuous loops

Here is an example of the HTML code for a table: <tbody> <tr>..</tr> <tr> <td class="tbl_black_n_1">1</td> <td class="tbl_black_n_1" nowrap="" align="center">23/07/14 08:10</td> <td ...

What steps can be taken to stop a list from exceeding the boundaries of its parent <div>?

Currently, I am dealing with a list (#this-list) that has an input box below it. Whenever a user submits something in the input box, it gets added to the list #this-list (all of this happens within react.js). The issue arises when the list grows too long a ...

Positioning a Three.js static CSS2DObject with respect to the camera's perspective

I am currently working on a unique program visualizer that utilizes Three.js to showcase various aspects of a program to the user. One crucial feature of this visualizer is allowing users to click on specific objects to view additional information about th ...

Switching between Jquery Slide up and Slide down animations

Currently, I am dealing with ASP.NET MVC 4 and have a nested list within my razor view structured as follows: <ul class="nav" id="product-cat-menu"> <li><a href="/Products/Index?category=2002">Dental <i class="fa fa-plus-square-o ...

Ways to duplicate a letter in HTML?

How can a character be printed repeatedly within a table cell using only HTML or HTML and CSS (excluding HTML5)? *(limiting to only HTML or a combination of HTML and CSS) ** The goal is to print the character "." across the entire length of the cell, wit ...

Problem with changing color on Active and Deactive status in PHP using jQuery

I'm looking to create a feature where clicking on an (i) tag will change its color between active and inactive states. The code works well, but when I click on any (a) tag, the color of the first (a) tag also changes unexpectedly. Here is my CSS: . ...

Incorporate content from HTML into various sections

Is there a way to dynamically extract the h4 headers and the first sentence from each section of this HTML, and then add them to a new div? function summarize() { let headings = document.getElementsByTagName("h4"); // Get all H4 elements let newsText = do ...

The left-floated image extends beyond the boundaries of the div

I have a situation where text and an image are combined but the cat image goes outside of the parent div. Is there a solution to this issue? View the code here <div style="border:1px solid #CCCCCC"> <img style="float: left;" src="http://plac ...