Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Jessica Perkins
Jessica Perkins
780 Points

How to get my text boxes to go left to right instead of up to down.

I have four boxes of text on my practice website and I don't want them to go from top to bottom. I need them to go left right. How do I do that?

2 Answers

Samuel Ferree
Samuel Ferree
31,722 Points

To display things left to right, select them with css, and set display: inline; Assuming there is enough width to fit all of them, they should be on the same line.

This works for me, although the textboxes appear to display inline before adding the custom css, the exact setup of your practice website may be forcing them to display: block

HTML

<input type="textbox">
<input type="textbox">
<input type="textbox">
<input type="textbox">

CSS

input[type="textbox"]
{
  display: inline;
}
Jessica Perkins
Jessica Perkins
780 Points

OK I may need to try that. How do I post my code on here so people can see what I'm doing wrong?

Also just realized my h1 tag isn't showing properly either lol.

Samuel Ferree
Samuel Ferree
31,722 Points

wrap it in three backticks,

```
code goes here
```

You can add the language after the first triplet of backticks

```HTML
<tag>Stuff</tag>
```