Jump to content

CM1 Issue- Text shifting up


8OO

Recommended Posts

I was setting up content that was left and right aligned along with a responsive table and it worked out perfectly on Notepad++ and W3 Schools

But then, I put it into my CMS editor, CM1 and it got all jacked up (as per usual...). The table content is moved inside for some odd reason....1908819791_CM1Error.thumb.png.f9a6e4b4f7b2bbced997ab7f307b8c84.png

 

When I saw this I thought, I'll just add a few <br> tags before the table content to move it down. It fixed one problem, but created another. So when my table gets to a smaller window size, there's too much white space between the Address/Telephone line and the table and it's super annoying...1937474761_CM1Error-Largegapusingbrtag.thumb.png.dd8689568ca6d715a6633c97d9aec1a8.png  

Is there a way this could be fixed so it's like the way I originally have it where everything is correctly spaced out? I'm pretty sure it's an issue with my HTML code, but I'm not sure as to what is causing the issue in CM1

Here's my code that works the way I would like it to on Notepad++ and W3 schools:

 

CSS

<head>
	<style>
		@media screen and (min-width: 901px) {
			.alignleft {
				float: left;
			}
			.alignright {
				float: right;
			}
		}
		tr:hover td{background-color:#ffff99;}
	
		th {
			color: white;
			font-size: 18px;
		}
		
		table {
			border-collapse: collapse;
			margin: 0;
			padding: 0;
			width: 100%;
			table-layout: fixed;
		}

		.link {
			color: #c69906;
		}
		
		td {
			word-wrap: break-word;
		}
				
		@media screen and (max-width: 900px) {
			table {
				border: 0;
			}

			table thead {
				border: none;
				clip: rect(0 0 0 0);
				height: 1px;
				margin: -1px;
				overflow: hidden;
				padding: 0;
				position: absolute;
				width: 1px;
			}
		
			table tr {
				border-bottom: 3px solid #ddd;
				display: block;
				margin-bottom: .625em;
			}
  
			table td {
				border-bottom: 1px solid #ddd;
				display: block;
				font-size: .8em;
				text-align: right;
			}
  
			table td::before {
				content: attr(data-label);
				float: left;
				font-weight: bold;
				text-transform: uppercase;
			}
			
			table td:last-child {
				border-bottom: 0;
			}
		}
	</style>
</head>

 

HTML

<h1 style="text-align:center;"><b><u>Title Here</b></u></h1>
<br>
<br>

<div>
	<div class="alignleft">
		<div><b>Location and Mailing Address:</b></div>
		<div>ABC</div>
		<div>DEF</div>
		<div>GHI</div>
		<br>
	</div>
	
	<div class="alignright">
		<div><b>Telephone:</b><a href="tel: 610-867-5309">Ex. #</a><span></div>
	</div>
	<div style="clear: both;"></div>
</div>


<h2>More Info Here</u></h2>
<div style="overflow-x: auto;">
<table style="width:100%">
	<thead>
		<tr style="background: linear-gradient(to right, #66002b 0%, #cc0055 100%);">
			<th scope="col"><b>Cat. 1</b></th>
			<th scope="col"><b>Cat. 2</b></th>
			<th scope="col"><b>Cat. 3</b></th>
			<th scope="col"><b>Cat. 4</b></th>
			<th scope="col"><b>Cat. 5</b></th>
		</tr>
	</thead>
	
	<tbody>
		<tr>
			<td data-label="Name"><b>Name Here</b></td>
			<td data-label="Email">Email Here</td>
			<td data-label="Location">Location Here</td>
			<td data-label="Phone">Phone Here</td>
			<td data-label="Title">Title Here</td>
		</tr>
	
		<tr>
			<td data-label="Name"><b>Name Here</b></td>
			<td data-label="Email">Email Here</td>
			<td data-label="Location">Location Here</td>
			<td data-label="Phone">Phone Here</td>
			<td data-label="Title">Title Here</td>
		</tr>
	</tbody>
</table>
<br>
<br>

 

Edited by 8OO
Additional comment
Link to comment
Share on other sites

I'm pretty sure it's an issue with my HTML code, but I'm not sure as to what is causing the issue in CM1

Edit: Didn't know I could edit my topic lol. Just added this into my original topic 

Edited by 8OO
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...