Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Is this possible?
How can i make my list(<li>) elements to be seen like table cells?
Update:
I need table look and feel, but also i need to use li tag,
I need to conserve the indentations
I do not need like this, I want the view when I delete the CSS (like this).
I found solution here
Thanks
If you want it to behave exactly like table add the following CSS:
ul, ol {
display: table;
}
li {
display: table-row;
}
Thought, for IE it works since version 8.
Here's the FIDDLE
Agree with Paulie_D. Please tell us little more about what you are trying to achieve.
But if you want to create a table like look and feel, you can add float to li and give padding or fixed height and width to individual <li>. You can also specify <ul> width, so it will wrap the <li> at a specific width.
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I want to display inner divs in a single row without giving width to outer div.
In a given code it is displaying vertically one after the other, if I don't add width.
heres DEMO
One option is to set the parent element to display: table and the child divs to display: table-cell. Remove any floats if you choose this method.
You could add display: inline-blockto the col_1class.
I'm really not sure what should be on the same line in your example. But if you are talking about the p element with class .btn, you may try to remove 'float: right;' as 'display: inline-block' is enough.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am working on a (html/css) website to improve my skills but I am not sure if I am doing it the right way, because I have a lot of floats and sizes. I also need help with some css things:
What I have:
What I need:
The red dimensions in the image are the dimensions I've tried to give the objects and which I am not sure if it is the correct way of doing it.
The black words are the things I would like to change, but I am not sure how I can do it in a good way.
All my code:
index.html:
http://pastebin.com/PZZY7bFA
style.css:
http://pastebin.com/HyEdM6qF
reset.css:
http://pastebin.com/gxqWzFHN
I did not post the css code of the navigation menu because it is already working in a correct way.
I would be very happy if anyone can help me.
Regards,
Engin
Well, I don't have that much time right now. But I tell you this:
Your logo is an object wich is an inline element, same as (link) and normal text.
To vertical center inline elements use line-height: ?px; in your css. Set the ? to the height of your header
To vertical center other elements, such as block elements (f.e. div) you can define the parent as a table cell display: table-cell; and assign vertical-align: middle; to your block element. Of course this would also work for inline elements but the first method is easier here, since you don't have to declare the parent as a table-cell.
Anyway, if you really want to design websites you have to get to know all the princeples and behaviors. Check the urls that were just posted and keep learning A LOT!
I hope you can finish the navigation now:)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I have a nested list which I want to be aligned to the right side of the head. Here's an example of a regular list:
And here's an example of the list I'm trying to get:
Notice that the list items are aligned to the right of the head. I tried using the "em" unit on the nested list to move the entire thing left, but that didn't work because of the varying head lengths. IE one head was named "Head" while another was "Super Long Head" so the amount of shifting needed was different. I'm trying to avoid having to style each nested list individually.
So how would I align the nested list to the right of the head?
Try the following code it works fine.
<ul>
<label dir="rtl">Head</label>
<li>Jaw</li>
<li>Kaiwn</li>
</ul>
What you may need to do is this:
ul{margin:0; padding:0;}
Ul li{margin-left:-10px;}
or you could try:
ul{margin:0 0 0 20px; padding:0;}
ul li{margin:0;}
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I feel like this is a very simple problem but I can't seem to wrap my head around it. What I have is a bunch of divs added to a container. Then I want those divs to freely position them self in any white space, but they must move from top to bottom, left to right. I also can not adjust the order of the divs. Here is an example of my problem http://jsfiddle.net/8GMGF/1/. I need the blue box to automatically move into the free space above it. Thanks for any input.
PS. I also tried flexboxes but they don't seem to be able to use free space either. Maybe I missed something.
The result you are looking for (with the subtle tweaks you want to make) might not be possible with pure html and css, you may wish to look into using a tiling plugin such as Masonary for jQuery:
http://masonry.desandro.com/index.html
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 8 years ago.
Improve this question
I have a search results page and I'd like to wrap each result in a simple box to differentiate between each group but I can't find anything on how to do this. All I found was w3schools page on the box model and that seems to affect the whole page so it isn't really what I'm looking for.
You'd need to wrap them in what's called a div this is essentially saying to a browser looking at the website "This is a block of something, treat it like that". You can create a div like this
<div class="result">Content in here!</div>
You can then assign all your divs the CSS class result this lets your use CSS code like
.result {
border: 1px solid red;
}