# Custom HTML Layout

**URL:** <https://community.hubspot.com/t/custom-html-layout/3005>\
**Category:** CMS Development\
**Created:** [August 11, 2017, 2:47pm UTC](https://community.hubspot.com/t/custom-html-layout/3005 "2017-08-11T14:47:48Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jlawal](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jlawal/32/5125_2.png) [@Jlawal](https://community.hubspot.com/u/Jlawal)\
**Post date:** [August 11, 2017, 2:47pm UTC](https://community.hubspot.com/t/custom-html-layout/3005/1 "2017-08-11T14:47:48Z")

</div>

Hello,

I’m trying to create two collapsible sections on [this webpage](https://www.groupcall.com/-temporary-slug-48456d05-7f2c-4de2-a3f1-7352cfe5226b?hs_preview=OSsCibzf-5294173596) (Under Popular Content). They will house links to other sections and are supposed to sit next to each other in the same row.

I have put coode into two Custom HTML modules. They don’t work as they are supposed to and they stack vertically rather than horizontaly.

Could anyone help me with this issue?

Many thanks,

Jamila

---

<div class="post-metadata">

**Author:** ![Jsum](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jsum/32/20405_2.png) [@Jsum](https://community.hubspot.com/u/Jsum)\
**Post date:** [August 11, 2017, 8:34pm UTC](https://community.hubspot.com/t/custom-html-layout/3005/2 "2017-08-11T20:34:59Z")

</div>

@Jlawal,

I’m not seeing the drop downs on the page. Could you provide your markup and css for us to take a look at, or better add the sections onto the page so we could get a full view of whats going on? I believe you could share a preview link so you wouldn’t have to publish.

---

<div class="post-metadata">

**Author:** ![Jlawal](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jlawal/32/5125_2.png) [@Jlawal](https://community.hubspot.com/u/Jlawal)\
**Post date:** [August 14, 2017, 3:34pm UTC](https://community.hubspot.com/t/custom-html-layout/3005/3 "2017-08-14T15:34:31Z")

</div>

Hi @Jsum,

Thanks for replying.

I’ve added the sections to the page which can be found [here](https://www.groupcall.com/-temporary-slug-48456d05-7f2c-4de2-a3f1-7352cfe5226b?hs_preview=OSsCibzf-5294173596).

Many thanks,

Jamila

---

<div class="post-metadata">

**Author:** ![Jsum](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jsum/32/20405_2.png) [@Jsum](https://community.hubspot.com/u/Jsum)\
**Post date:** [August 14, 2017, 3:47pm UTC](https://community.hubspot.com/t/custom-html-layout/3005/4 "2017-08-14T15:47:57Z")

</div>

@Jlawal,

Your code is all kinds of out of wack. Could you post the html, css, javascript, and hubl you are using for that section? maybe I can sort it out.

---

<div class="post-metadata">

**Author:** ![Jlawal](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jlawal/32/5125_2.png) [@Jlawal](https://community.hubspot.com/u/Jlawal)\
**Post date:** [August 14, 2017, 3:52pm UTC](https://community.hubspot.com/t/custom-html-layout/3005/5 "2017-08-14T15:52:24Z")

</div>

That would be great! I pasted the code directly into two Custom HTML modules within HS @Jsum.

The following is for the **Quick Start** guide:

\<head\>

\<meta name=“viewport” content=“width=device-width, initial-scale=1”\>

\<link rel=“stylesheet” href=“[https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css](https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css)”\>

\<script src="[https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"\>\</script](https://community.hubspot.com/)\>

\<script src="[https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"\>\</script](https://community.hubspot.com/)\>

\</head\>

\<body\>

\<div class=“container”\>

\<a href=“#demo” data-toggle=“collapse”\>\<div style=“text-align: center;”\>\<img src=“[https://www.groupcall.com/hubfs/Quick-Start-3.png](https://www.groupcall.com/hubfs/Quick-Start-3.png)” alt=“” title=“Quick-Start-3.png” width=“150” height=“150”\>\</div\>\</a\>

\<a href=“#demo” data-toggle=“collapse”\>\<div style=“text-align: center;”\>\<span style=“font-size: 30px;”\>Quick Start Guides\</span\>\</div\>

\<div id=“demo” class=“collapse”\>

\<br\>\<div style=“text-align: center;”\>\<span style=“font-size: 20px;”\>Voice Messages\<br\>

Data Quality Reports\<br\>

Tweeting\<br\>

MIS Compatibility\<br\>

Notifications from Groupcall\<br\>

Status Page\<br\>

Authorise Messages\<br\>

Metrics\<br\>

Schedule Messages\<br\>

Export Data\<br\>

Managing Contacts\<br\>

Managing Saved Messages & Templates\<br\>

Request SMS credits\<br\>

Send Feedback to Groupcall

\</div\>

\</div\>

\</body\>

This code is for the **FAQs** section:

\<!DOCTYPE html\>

\<html\>

\<head\>

\<meta name=“viewport” content=“width=device-width, initial-scale=1”\>

\<link rel=“stylesheet” href=“[https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css](https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css)”\>

\<script src="[https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"\>\</script](https://community.hubspot.com/)\>

\<script src="[https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"\>\</script](https://community.hubspot.com/)\>

\</head\>

\<body\>

\<div class=“container”\>

\<a href=“#demo” data-toggle=“collapse”\>\<div style=“text-align: center;”\>\<img src=“[https://www.groupcall.com/hubfs/FAQ.png](https://www.groupcall.com/hubfs/FAQ.png)” alt=“” title=“FAQ.png” width=“150” height=“150” style=“display: block; margin-left: auto; margin-right: auto;”\>\</div\>\</a\>

\<a href=“#demo” data-toggle=“collapse”\>\<div style=“text-align: center;”\>\<span style=“font-size: 30px;”\>Frequently Asked Questions\</span\>\</div\>

\<div id=“demo” class=“collapse”\>

\<br\>\<div style=“text-align: center;”\>\<span style=“font-size: 20px;”\>Question 1\<br\>

Question 2\<br\>

Question 3\<br\>

Question 4\<br\>

Question 5\<br\>

Question 6\<br\>

Question 7\<br\>

Question 8\<br\>

Question 9\<br\>

Question 10\<br\>

Question 11\<br\>

Question 12\<br\>

Question 13\<br\>

Question 14

\</div\>

\</div\>

\</body\>

\</html\>

---

<div class="post-metadata">

**Author:** ![Jsum](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jsum/32/20405_2.png) [@Jsum](https://community.hubspot.com/u/Jsum)\
**Post date:** [August 14, 2017, 4:36pm UTC](https://community.hubspot.com/t/custom-html-layout/3005/6 "2017-08-14T16:36:27Z")

</div>

@Jlawal,

I see quite a few issues here.

1. you are doubling up on your css and js calls. This can have a lot of different effects, all of them negative, such as canceling of styles and functions that are needed.

1. both of these section have their own head section. You should only have one head section per page, and you page already has one. It can be edited by clicking edit → edit head. You can place your link tags there.

2. You don’t need the meta viewport tag. It’s already included on your site.

3. You don’t need the jQuery script, it is already included in hubspot pages by default.

4. Your bootstrap.js link should go in the footer.

2. You are already in the body tag by default. A document should only have 1 body tag. Essentially what you have done is put two different html documents inside of a third html document.

put this in the head of your page (edit → edit head) once:

`<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">`

put this in the footer of your page (in a custom html module at the bottom of the page for instance) once:

`<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>`

strip your code of the heads and the body tags:

```auto
<!-- The following is for the Quick Start guide: -->

<div class="container">
	<a href="#demo" data-toggle="collapse">
		<div style="text-align: center;">
			<img src="https://www.groupcall.com/hubfs/Quick-Start-3.png" alt="" title="Quick-Start-3.png" width="150" height="150">
		</div>
 	<div style="text-align: center;">
 		<span style="font-size: 30px;">
 		Quick Start Guides
 		</span>
 	</div>
	</a>
 <div id="demo" class="collapse">
 	<br>
 	<div style="text-align: center;">
 		<span style="font-size: 20px;">
 		Voice Messages<br>
 		Data Quality Reports<br>
 		Tweeting<br>
 		MIS Compatibility<br>
 		Notifications from Groupcall<br>
 		Status Page<br>
 		Authorise Messages<br>
 		Metrics<br>
 		Schedule Messages<br>
 		Export Data<br>
 		Managing Contacts<br>
 		Managing Saved Messages & Templates<br>
 		Request SMS credits<br>
 		Send Feedback to Groupcall
			</span>
		</div>
 </div>
</div>

<!-- This code is for the FAQs section: -->

<div class="container">
	<a href="#demo" data-toggle="collapse">
		<div style="text-align: center;">
			<img src="https://www.groupcall.com/hubfs/FAQ.png" alt="" title="FAQ.png" width="150" height="150" style="display: block; margin-left: auto; margin-right: auto;">
		</div>
		<div style="text-align: center;">
			<span style="font-size: 30px;">
				Frequently Asked Questions
			</span>
		</div>
	</a>

	<div id="demo" class="collapse">
		<br>
		<div style="text-align: center;">
			<span style="font-size: 20px;">
				Question 1<br>
				Question 2<br>
				Question 3<br>
				Question 4<br>
				Question 5<br>
				Question 6<br>
				Question 7<br>
				Question 8<br>
				Question 9<br>
				Question 10<br>
				Question 11<br>
				Question 12<br>
				Question 13<br>
				Question 14
			</span>
 		</div>
	</div>
</div>

```

Do this and let me know when it’s updated.

---

<div class="post-metadata">

**Author:** ![Jlawal](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jlawal/32/5125_2.png) [@Jlawal](https://community.hubspot.com/u/Jlawal)\
**Post date:** [August 15, 2017, 8:47am UTC](https://community.hubspot.com/t/custom-html-layout/3005/7 "2017-08-15T08:47:15Z")

</div>

Thank you @Jsum!

I’ve updated the page with the information. Thank you for taking the time out to explain what was wrong with the code as well!

Many thanks,

Jamila

---

<div class="post-metadata">

**Author:** ![Jsum](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jsum/32/20405_2.png) [@Jsum](https://community.hubspot.com/u/Jsum)\
**Post date:** [August 15, 2017, 9:24am UTC](https://community.hubspot.com/t/custom-html-layout/3005/8 "2017-08-15T09:24:57Z")

</div>

@Jlawal,

Not a problem.

Ok so this looks better. now the issue is with your CSS. Both of your drop downs have a wrapper with the class “container”. I don’t particularly like this because it is so generic that it is almost guaranteed that it is used in other places, particularly in hubspots default framework css (it’s based off of bootstrap2 and bootstrap uses “container” as a class). This is fine if you are going to use it inline with bootstraps css rules, the issue that i’m seeing is that you have fixed widths applied to it. This is why you the sections are misaligned and hanging off the page.

are each of these placed in there own custom html module in your module? If not you should place two custom html modules next to each other (half and half) and put these each in there own to separate them.

The css causing the alignment issues is this:

```auto
@media (min-width: 1200px)
grid.less:10
.container {
 width: 1170px;
}

@media (min-width: 992px)
grid.less:85
.container {
 /* width: 970px; */
}
@media (min-width: 768px)
grid.less:85
.container {
 /* width: 750px; */
}

```

Bascally a less file (preprocessed css) has static width rules for a class of “container”. Turn these off and your sections will snap into place.

probably the best way to do this would be for you to change the class name “container” to something like “pop\_container” in your html. This would break your html from that css and any other css applied to the “container” class.

---

<div class="post-metadata">

**Author:** ![Jlawal](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jlawal/32/5125_2.png) [@Jlawal](https://community.hubspot.com/u/Jlawal)\
**Post date:** [August 15, 2017, 9:54am UTC](https://community.hubspot.com/t/custom-html-layout/3005/9 "2017-08-15T09:54:11Z")

</div>

I’ve edited the class as recommended but i’m still having issues with alignment and the ‘Frequently Asked Questions’ collapsible menu. Clicking on it seems to open and collapse the Quick Start Guides. Is this an effect of the alignment do you think? @Jsum

The code is placed in the seperate custom HTMLs:

 ![d.PNG](https://d2qpr2jzcazej7.cloudfront.net/original/3X/b/f/bf618423074e322dc56feac166ae0a6a46b9476c.png)  
CH

---

<div class="post-metadata">

**Author:** ![Jsum](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jsum/32/20405_2.png) [@Jsum](https://community.hubspot.com/u/Jsum)\
**Post date:** [August 15, 2017, 9:57am UTC](https://community.hubspot.com/t/custom-html-layout/3005/10 "2017-08-15T09:57:38Z")

</div>

@Jlawal,

The class is still “container”.

```auto
<div class="container">
 <a href="#demo" data-toggle="collapse">
....

```

You added pop\_container to the module when you should have replaced “container” within the actual code.

---

<div class="post-metadata">

**Author:** ![Jlawal](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jlawal/32/5125_2.png) [@Jlawal](https://community.hubspot.com/u/Jlawal)\
**Post date:** [August 15, 2017, 10:05am UTC](https://community.hubspot.com/t/custom-html-layout/3005/11 "2017-08-15T10:05:29Z")

</div>

Sorry i didn’t realise you meant within the custom html.

I’ve replaced this now but am still having the same issues @Jsum

---

<div class="post-metadata">

**Author:** ![Jsum](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jsum/32/20405_2.png) [@Jsum](https://community.hubspot.com/u/Jsum)\
**Post date:** [August 15, 2017, 10:07am UTC](https://community.hubspot.com/t/custom-html-layout/3005/12 "2017-08-15T10:07:56Z")

</div>

@Jlawal,

The class still hasn’t changed. did you publish the template?

---

<div class="post-metadata">

**Author:** ![Jlawal](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jlawal/32/5125_2.png) [@Jlawal](https://community.hubspot.com/u/Jlawal)\
**Post date:** [August 15, 2017, 11:14am UTC](https://community.hubspot.com/t/custom-html-layout/3005/13 "2017-08-15T11:14:34Z")

</div>

Yes. This is how i’ve done it @Jsum:

![Hubspot..gif](https://d2qpr2jzcazej7.cloudfront.net/original/2X/3/38ec62fdc66b359ed7e85cf4983909441443fc4d.gif)
