What steps can I take to unite these two elements?

I'm having trouble adjusting the spacing between the #bigimage and #textarea elements while keeping them centered as a col-12 on small screens.

Do you think using a media query would solve this issue? I attempted to place them in a separate container, but encountered unexpected behavior when testing it on mobile devices.

The colored borders in the code below are there for my own reference. As a beginner, any feedback on my code would be greatly appreciated.

header {
  border: 3px solid red;
  text-align: center;
  margin-top: 30px;
}

li {
  display: inline;
  text-align: center;
  padding: 3%;
}

img {
  width: 300px;
}

ul {
  border: 2px solid green;
  margin-bottom: 20px;
  margin-top: 40px;
}

h2 {
  border: 2px solid yellow;
  margin-top: 30px;
}

#textarea {
  border: 3px solid green;
  text-align: justify;
  margin-top: 30px;
  width: 200px;
}

#bigimage {
  border: 3px solid green;
  text-align: center;
}

p {
  border: 2px solid red;
  position: relative;
  top: 50%;
  transform: translateY(-50%);
  width: 300px;
  margin: 0 auto;
}

#mainstuff {
  width: 50% margin: 0 auto;
  border: 3px solid yellow;
}

.container {
  border: 5px solid blue;
}

.row {
  margin-top: 30px;
  position: relative;
}

img {
  border: 2px solid red;
}

#textandphoto {
  width: 800px;
}

@media (min-width: 1500px) {
  .container {
    max-width: 900px;
  }
}
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">

<div class="container">
  <div class="row">
    <div class="col-12">
      <header>
        <h1>Raphael Hetherington</h1>
        <h2>11+ Tutor</h2>
        <ul>
          <li><a href="">About Me</a></li>
          <li><a href="">11+ Tuition</a></li>
          <li><a href="">Programming</a></li>
          <li><a href="">Testimonials</a></li>
          <li><a href="">Contact</a></li>
        </ul>
      </header>
    </div>
  </div>
  <div class="row" id="mainstuff">
    <div class="col-12 col-md-6" id="bigimage">
      <img src="//lorempixel.com/400/200/abstract/5/" alt="">
    </div>
    <div class="col-12 col-md-6" id="textarea">
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Illum omnis harum nesciunt repellendus laudantium quam quo ea, placeat, totam rem laboriosam vero, asperiores architecto. Dolores earum, architecto nemo molestiae quo. Lorem ipsum dolor sit
        amet, consectetur adipisicing elit. Corporis accusamus modi eaque placeat voluptates nihil quasi non et similique magnam architecto itaque nobis expedita amet, provident doloribus eveniet quis explicabo?</p>
    </div>
  </div>
</div>

Answer №1

.editor {
      border: 2px solid blue;
      text-align: center;
      padding-top: 10px; /* 10 instead of 20px*/
      width: 180px;
 }

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

Incorporating the FLEX property into my code has been a challenge as it is not functioning properly on iOS 7 and 8 devices. Does anyone have any tips or suggestions on how to

While utilizing FLEX in my code, I noticed that the output is not what I expected on iOS 7/8 devices. <div className="modal-row"> <div className="col1"> <span>{dict.YourServiceNumber}</span> </div> <div ...

Assess how my website is displayed to an algorithm

A website can be accessed not just by a user through a browser, but also by programs, bots, and crawlers. I have a website hosted on Google App Engine with Python that features non-static HTML pages generated by a Python program by manipulating strings. Th ...

several tables all set to the identical TD width

Using a css sheet, I have formatted two tables. The first table is used for filter/sort selection, while the second table is a scrollable data table. div#scrollTableContainer { width: auto; margin: 20px; /* just for presentation purposes * ...

How can an HTML5 application be configured to enable access to intranet and local files?

It's a known fact that accessing the local path of a file added using a file input field or drag-and-drop is not possible even with the new FileAPI. Whether this limitation is good, bad, or ugly is not up for debate. The FileAPI specs clearly state th ...

Removing specific text from a textarea containing a vast quantity of information

I developed a simple XML formatter using HTML and Javascript. I am looking to incorporate a delete feature into it. Essentially, I want the ability to remove an entry without affecting any other data. <contact <!--Jane Smith--> first_name="Jane" ...

React TSX file not recognizing JSON data stored in an HTML data attribute

I am having some trouble with implementing the password toggle component from the Preline UI. Here is how the component looks: "use client" import React, { ChangeEvent, MouseEventHandler, useEffect } from "react"; export default functi ...

Enhancing the Syntax of If and If Else in Jquery Functions

I'm struggling to simplify and optimize this block of code. Would appreciate any help in making it more efficient! var status = "closed"; $(document).on('click', '[data-toggle-nav]', function(event) { if ($(this) && status = ...

Transferring data from JavaScript to PHP with the help of AJAX

I am encountering issues with my code, as I cannot seem to successfully send coordinates from JavaScript to PHP using AJAX. Although I can retrieve values from JavaScript into a textbox, the values are not being transferred to PHP. Any assistance on resolv ...

How can I reload the filtered data in a table after making changes to a field with a Modal form in a Spring Boot application using JPA, Thymeleaf,

In my project table, I have utilized the following Controller code to populate the projects @RequestMapping(method = RequestMethod.GET) public String listProjects(Model model){ model.addAttribute("projects", this.projectService.getProjects()) ...

Bizarre CSS Transitions and Scaling Quirks in Webkit

Working on a website, you can check it out here In Chrome, some strange behavior occurs when the window reaches a certain resolution. Specifically, at 943 pixels width, white bars appear next to images when hovering over them, giving the impression that t ...

Adjust the background color of a list item using Typescript

At the top of my page, there's a question followed by a list of answers and the option to add new ones. You can see an example in the image below. https://i.stack.imgur.com/NPVh7.jpg The format for each answer is "(username)'s response: at this ...

Why won't my button's text resize?

I am facing an issue with my button's CSS code. In Chrome, when I resize the window to view the mobile layout, the text overflows outside of the div. a.syntra-green-button { background-color: #6faf3c; border: 1px solid #9dcc77; color: w ...

"Enhancing Forms with Multiple Event Listeners for Seamless Sub

I'm working on creating a countdown timer with 3 buttons for controlling the timer: start, cancel, and pause. The timer itself is a text input field where you can enter a positive integer. I need to use core JavaScript, not jQuery Start Button: Init ...

Employing CSS animations to elevate div elements

Currently, I am working on animating a table of divs and trying to achieve an effect where a new div enters and "bumps up" the existing ones. In my current setup, Message i3 is overlapping Message 2 instead of bumping it up. How can I make Messages 1 and 2 ...

Using php variable to pass data to jquery and dynamically populate content in jquery dialog

I am facing challenges trying to dynamically display MySQL/PHP query data in a jQuery dialog. Essentially, I have an HTML table with MySQL results. Each table row has an icon next to its result inside an anchor tag with the corresponding MySQL ID. echo &a ...

Transforming RGBA, HSL, and HSLA color values into RGB format, or encapsulating them within a java.awt.Color instance

Seeking information on algorithms that can convert RGBA, HSL, and HSLA colors to RGB colors, or a Java library that performs this conversion and returns a java.awt.Color object. Any recommendations or assistance would be greatly appreciated! ...

What could be preventing me from typing in the input field that's linked to an Angular model in Firefox browser?

Having trouble entering text in input on Firefox, even though it works fine on Chrome. No CSS issues or jQuery used. Here is my HTML code: <div class="todo_content" style="width:66%"> <input class="todo_add_input" autofocus="autofocus" ...

No DIV elements are permitted within the tab content

I implemented a simple jQuery tab code that I found online to display dynamic content: This is the code snippet that I inserted into the HEAD section of my HTML page: <script src="js/jquery-1-9-1.js"></script> <script type="text/javascri ...

Obtaining the identifier of the grandparent element that is of the "

I'm working on a project where I have a dynamic element called .courseBox. It's an <li> element that will be placed within a <ul> container. Each .courseBox has a red "x" button that, when clicked, removes it from the <ul>. Here ...

Converting HTML's nested <ul> element into JSON format

I am working on developing a form builder application that allows users to create forms through drag and drop functionality. The main structure of my form is based on the <li> tag, with nested <li> and <ul> tags present underneath it. On ...