I’m pretty new to web development, and I decided to recreate a few sites without looking at their source for practice (before I design and code them myself). Everything was going well until I added <p>
tags inside my div
s.
Things I’ve tried: z-index
, using span
s instead, rebooting my PC, closing my browser, using another browser. It’s probably a noob mistake, and possibly a duplicate. If it is a duplicate, I’d appreciate you linking me to the other question rather than closing it without context. I’ve already tried searching for it, and I can’t find any results.
Problem:
<div id="below-headbar">
<div id="cloud-based">
<img src="images/cloud-based.png">
<h1>CLOUD BASED</h1>
<p>Productimize comes with the unlimited cloud hosting space for your customizer. Whenever we release a new version of our product you get the new features with all the benefits at zero cost.</p>
</div>
<div id="dynamic-pricing">
<img src="images/dynamic-pricing.png">
<h1>DYNAMIC PRICING</h1>
<p>For each and every customizable part of the product, pricing can be fixed accordingly. Regardless of the eCommerce platform (Shopify, BigCommerce, or Magento), the dynamic pricing can be applied.</p>
</div>
<div id="print-ready">
<img src="images/print-ready.png">
<h1>PRINT READY</h1>
<p>Our customization engine captures all the design details given by customers. Customized design can be exported to print ready files in PDF, PNG, EPS and TIF formats. This way the whole order flow can be automated seamlessly.</p>
</div>
</div>
This is the HTML that I’m trying to get work. Everything inside it works, except for the text inside of the paragraph tags. As I said, I’ve already tried a few things. Here’s the CSS that applies to it:
#below-headbar div p {
font-family:'Roboto', sans-serif;
font-weight:400;
line-height:27px;
color:#333;
width:350px;
height:250px;
margin:auto;
}
Any help/troubleshooting is appreciated. Here’s the JSFiddle (Entire website so far, as I said, it’s a copy of another website for practice):
https://jsfiddle.net/puvnw3a1/2/
The website looks a bit ugly without the images, but don’t worry about that. Again, it’s probably some beginner mistake. Thanks.
3
Answers
A quick look at your jsfiddle it says that your
p
tag has a font size of 0.try:
Remove
font-size: 0;
from#below-headbar
, updated example:Similar to what Awad said in his comment, I would suggest setting the
font-size
property in your css for#below-headbar div p
so that it doesn’t inherit the size from any other elements.