Jump to content

Is this proper use of <br/>


nyuille

Recommended Posts

Hello -

 

Trying to confirm if I can use <br/> this way, meaning is it best practice.

 

I have text like below, which is under an image in the website.

 

One thing that sets Mountain Village apart – <br/>and keeps us at number one on Trip Advisor – is <br/>
our gondola system. We provide this <br/>form of transportation to the public for free. Yes, free. <br/>
If you prefer to navigate through Mountain Village by <br/>car, you have a number of places to park within town limits, <br/>
though we do recommend you retire those <br/>car keys most days.
You can look at this website below and see the content under each of the 5 images.
I am trying to achieve this wrapping effect with <br/> or is there a better way to do this?
Link to comment
Share on other sites

That's not a good way to use the <br> element, because the line break does not have any meaning in that text. The only good uses for <br> elements I can think of are poetry and for separating lines in a postal address.

 

If you want the text to wrap at a particular point, just change the width of the element that is containing the text.

Link to comment
Share on other sites

Consider box 1.

 

I have an image, a link button, and text that should all be grouped together, so I have called this <div box1>.

 

.box1,.box2{
float: left;
width: 50%;
In order to size the text within this div, I think I need to put a class on it and call out its width separate from its parent since parent already has a width of 50%?
Link to comment
Share on other sites

The text would be wrapped in a <p> element inside one of the boxes. You can set the width of the <p> element and set its left and right margins to "auto" to center it inside the column.

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...