Is using a no-break space to move text or images further down the page bad practice?

Is using a no-break space to move text or images further down the page bad practice?
0

#1

So I’m using a no-break space to move text and images further down the page

For example

    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <h1 id="homeh1" class="text-center text-primary"><strong>Web Development</strong></h1>
    <p>&nbsp;</p>
    <h2 class="text-center text-primary">Portfolio</h2>
    <p>&nbsp;</p> 

is this a bad?


#2

Yes, it is. You can just add margin to the h1 and h2 tag.


#3

It’s not bad - but it’s not great - if you want space from the top of a block use padding in your CSS


#4

is there a way of creating empty space in bootstrap or should I just stick with using padding and margins?

cheers :slight_smile:


#5

Padding and margin should do.


#6

You could create a div class that is essentially just a “spacer” block. If you’re always going to be putting space between these elements though, just modify those elements as suggested by @BenGitter and @jemagee


#7

I was thinking I should read up on layouts so I bought ‘HTML & CSS - Design and Build Websites’ by Jon Duckett. Really nice book, I’m thinking about getting the javaScript edition too, have you read it?

thanks for the help :slight_smile:


#8

reading?