What could be causing this text to not center properly on mobile devices?

Here is the main content. There are no alignment commands in the CSS or HTML.

Check out the jsfiddle: https://jsfiddle.net/9t4afmx3/

Any idea why it's left-aligned on mobile devices?

<body>

<p align="center"><img src="Screen Shot 2016-05-04 at 12.40.50 PM.png" width="1280" height="434.6" usemap="#Map" align="center" border="0" />
  <map name="Map" id="Map">
 <area shape="rect" coords="56.7,340.1,344.8,434.6" href="ourteam" />
 <area shape="rect" coords="472.37,340.1,755.8,434.6" href="ourservices" />
 <area shape="rect" coords="944.7,340.1,1228.15,434.6" href="aboutchillcreatives" />
  <area shape="rect" coords="472.30,500,804,5150" href="ourservices" />
 </map>
 </p>


<div align="center">
<pre class="chillfont"><span class="chillfont">CHILL CREATIVES IS</span>

  <span class="chillfont">FORFRONT...</span><span class="BLACKWHITE">IN AN
  </span><span class="BLACKWHITE">UNEQUIVOCALLY
 </span><span class="BLACKWHITE">CHILL FASHION.</span>
 <a href="ourservices">
 <img src="Screen Shot 2016-05-03 at 5.12.26 PM.png"   width="1200" height="1000"/>
 </a>
 </div>
 </body>
 </html>

Answer №1

There isn't an align attribute in either a div or a p element. The following code is incorrect:

<div align="center">

To center the text, you should use

<div style="text-align:center">

This will properly center the text within the element.

Answer №2

Consider using text-align: center; as an alternative.

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

Issue when attempting to animate an SVG point using translateX transformation

I am attempting to create a basic animation using the translate X property on a section of my svg when hovering over the element. Here is the code I have so far: <html> <style> .big-dot:hover { transform: translateX(20px); animat ...

What is the method for presenting text based on the chosen Select Option?

I attempted to achieve this using hrefs and ids, but it did not meet my requirements. This is the desired format: div.selectcountry { margin-bottom: 10px; font-family: arial; font-size: 12px; } div.countrydepartment { font-family: ...

JavaScript script to modify the parameter 'top' upon clicking

Here is the pen I've made. HTML <div class = 'cc'> <div class = 'bb'><div class = 'aa'> Some word </div></div> </div> CSS .cc { width: 100%; min-height: 90px; margin: 0; ...

What is the process for utilizing html4 or previous versions in eclipse mars?

I recently started using Eclipse and my version of the software automatically supports html5. However, when I try to use outdated tags that are not compatible with html5, I encounter errors. Can someone please provide guidance on how I can switch to usin ...

Create styles for each component based on their specific props when designing a customized Material-UI theme

I am having trouble styling the notchedOutline of a disabled <OutlinedInput /> in my custom MUI theme. My goal is to make the border color lighter than the default color when the input is disabled. Here is what I have attempted so far: const theme = ...

Having trouble choosing a dropdown value with ng-model; the first item keeps showing up as blank when selected

When I attempt to select a dropdown value inside an AngularJS function by setting the value to the ng-model, the dropdown initially shows a blank value selected. Below is my HTML code: <select class="pulldown" ng-model="test" ng-options="obj as obj.des ...

Tips for organizing list items in a grid format using CSS and HTML

In my div block, the width is not fixed. Inside the div, there is a list block with 11 items that I want to display evenly like this: ##item## ##item## ##item## ##item## ##item## ##item## ##item## ##item## ##item## ##item## ##item## I&a ...

Guide on how to organize a list into three columns using a single ul tag

Is there a way to split a ul list into 3 columns using CSS? This is how my HTML structure looks like: <ul> <li>Test</li> <li>Test</li> <li>Test</li> <li>Test</li> <li> ...

Create an HTML selection element based on the value selected in the previous element using jQuery

I have an issue with generating a third HTML select element based on the selection of a first HTML select element and the use of an AJAX function. The process works correctly for the second select element, but when I try to generate the third select elemen ...

Collaborating with interactive icon in input group

I'm having trouble getting the textbox and icon to be in the same line, like a bootstrap input group. The icon is also clickable. <div class="input-group"> <asp:textbox id="txtParentCategoryCode" runat="server" cssclass="input-text normal" m ...

What is the method to create a link that doesn't take up the entire page?

As a beginner in HTML, I have been working on a website for fun and facing an issue with buttons. When I add a button, the entire area becomes clickable, even if there is empty space around it. This means that you can click on the left or right side of the ...

Angular 5: Transforming and Concealing CSS Class Names

Can CSS selectors be renamed or obfuscated in an Angular CLI project? Many top websites like Google and Facebook use randomized CSS names for various reasons, such as preventing website scripting through targeting static class names. I would like to imple ...

Determining the Size and Color of Squares in a Treemap Based on Content with D3.js

I encountered an issue with a treemap visualization. I came across an example that is similar to my situation, which can be viewed here: In the demo, you can see that the size of each square in the treemap is determined by the content size. However, all s ...

Ways to center items within a column using Bootstrap

I'm working on a React project with Bootstrap and I'm trying to align the contents of my second column to the bottom. However, everything I've tried so far hasn't been successful. I've seen others achieve this layout but for some r ...

"Develop a mobile application using PhoneGap designed specifically for use on iPad and

Looking to create an app for iPad and iPad Mini using PhoneGap. While I have some basic knowledge of HTML and CSS, I am struggling with adjusting the image proportion, width, and height of the app. I want to write code that will adapt properly to the vary ...

Linking a radio button to another mirrored radio button for selection

It should be a straightforward task. I have two sets of radio buttons that mirror each other, known as set A and set B Set A includes buttons 1, 2, and 3 Set B also consists of buttons 1, 2, and 3 The desired behavior is for clicking button 1 in set A t ...

Bootstrap's ability to display panels of equal height across multiple rows is a game

Just started using Bootstrap 4 after being familiar with Foundation for years. In Foundation, equalizer was a tool to ensure divs had the same height, which would be applied to all divs within a container. I understand that Bootstrap uses Flex, but I&apos ...

CSS: The deleted style refuses to disappear

Despite removing CSS code from my Rails application, after restarting the server and refreshing the page, I still see that the code is in effect. Even when inspecting the elements using Chrome, the code remains visible. @media screen and (min-width: 961px ...

Manipulating toggle buttons using CSS and jQuery

Check out this jsfiddle to see my attempt at creating a toggle switch in the form of a mute button. The toggle button shows the current setting: mute or unmute When hovered over, it displays the alternative setting However, I am encountering an issue wh ...

Integrate CSS and Javascript Plugins into your Ruby on Rails application

I am utilizing an HTML, CSS, and JS template to design the interface for my Rails application. Within this template, there are several plug-ins that are required in both CSS and JS formats. I have stored these plug-ins within the "/assets/plugins/" directo ...