Is it possible to left justify list items in a UL - html-lists

I have a basic unordered list except that I am using a list-style-type of none. This removes the bullets from the list. unfortunately it also right justifies the items in the list. Is it possible to left justify the items in the list?

I am actually confused about why they are being right justified. If I run a basic example in a fiddle they stay to the left.
If you want the li's to move more to the left then just add padding-left: 0; to the ul's class. If there is parent element that is applying the right justification then you can add text-align: left; to the ul's children to override it.
here is the fiddle.

Related

Move a div up and down based on mouse Move

I have this aside element which is has a position:fixed; property. Inside it, i have another div.inner which will hold elements which might be many and therefore might exceed the window.height();
Now, i need to solve this problem based on mouse scroll event on the div.inner element. I need to move the inner div top or down based on mouse scroll up or down events.
Please have a look at this website which demonstrates exactly what i need on the left were they have the logo and menus. Try moving your mouse up or down on that element and see.
Here is my attempt which didn't go so well.
Im not gonna write the entire code, but the concept from the page is:
pageHeigth = 200px
menuHeight = 250px
menuOverflow = menuHeight - pageHeight (50px)
Mouse positioned at the top: Menu CSS = "top:0px"
Mouse positioned at the bottom: Menu CSS = "top:-50px" (negative menuOverflow)
And of course interpolate the postion between top/bottom depending on mouse position. And also, using the terminology "mouse scroll" in your question makes it ambigous to understand, i believe "mouse move" is a better wording. "Scroll" makes me think about mousewheel or the page scrolling

Z-index not working on IE8 where top menu falls behind left hand menu

I'm having trouble with my top menu falling behind my left hand menu at http://www.spanish-bookworld.com/delete-spanish-books.html
I have used for the top menu. Everything I've done to put the left hand menu behind it hasn't worked.
Does anyone have a solution to this issue?
I have tested it and here what should fix the problem: Try to set z-index on your "#menu li" also, not only on div, with "!important" rule in your css.css file, i.e:
#menu li {
z-index: 99999 !important;
}

How do you prevent hidden (overflow) elements from being rendered?

I have an absolute positioned div off the side of the page with just a bit sticking in. I have applied overflow: hidden to html and the parent div, which gets rid of the scroll bar, but people can still use the middle mouse button to move the page across.
Is there a way to prevent anything that overflows from actually being rendered on the page or simply prohibit middle mouse scrolling?
maybe you need to set overwflow-x and overflow-y, like this:
.class {
overflow-x: hidden;
overflow-y: hidden;
}
if it's not help add some !importanta to this style.

How to hide treecols in treeview?

I try to hide treecols in treeview in XUL by setting style to display: none. The labels of treeview rows also disappear however. How can I hide treecols while keeping rows visible?
I guess that you mean to hide the column headers in a tree element. The tree element supports hiding individual columns so when you use display: none style on a column header the entire column is hidden with it. Instead you should use height: 0px; overflow: hidden; style on the treecols element - technically speaking it won't be hidden then but it won't be visible on screen either.

Page jumps to the top when checkbox is clicked

I'm calling handleNotableTypeSelect method on the click of the check box, everything is working fine but the page jumps to the top.
this.$hideInactiveCheckbox.click(
this.handleNotableTypeSelect.createDelegate(this));
handleNotableTypeSelect: function(e) {
//e.preventDefault();
if (this.$hideInactiveCheckbox.attr('checked')) {
this.isActive = "^active$";
this.$connTable.fnFilter(this.isActive, 1,true);
}
else {
this.$connTable.fnFilter('', 1);
}
//return false;
}
My case was that the checkbox was hidden (due to CSS design). the original input checkbox had position set to 'absolute' so when the user clicked the checkbox the page "jumped" to the real checkbox position.
EDIT:
In some cases there are styled "fake" checkboxes. the real checkbox element is hidden in some bad practice way.
My case was that the real checkbox element had absolute positioning and hidden and that cause the page jump to top of the window.
Possible solution:
Check if the checkbox element has the following CSS rule
position: absolute;
if yes, removing this rule can fix this issue.
This may related to the following issue:
input checkbox in div jumps to top of page on firefox
I've actually been seeing errors about this in all kinds of frameworks, and for the most part, people post framework specific answers. If you're hiding the check box, try using display: none on it, it seemed to work for the post above. I'm still trying to hunt down a fix (since I'm not hiding my checkboxes, I'm trying figure out why checkboxes in a modal cause the screen to jump to the top of the modal on click).
Several frameworks and css tricks hide the checkbox using position: absolute.
That is correct because we need to hide the checkbox only from screen, while Screen Readers must have access to it in order to announce it correctly. But display:none hides it from them too and users with accessibility issues can't click it.
The most suitable solution is to add position:relative to checkbox container and adjust checkbox position using top: if needed.
If your check box has position: absolute, in most cases just wrapping it (input and label elements) with a div should be enough.
If the checkbox has been positioned absolute to hide it and the interaction occurs on the label (which is commonplace when styling checkboxes beyond the default UI), the page will scroll to wherever the checkbox input is positioned despite the click event occurring on the label. so if you've added top:-9999px; for example, the page will jump right up to where it's now positioned.
What you want instead, is to remove it from the rendered layout without moving it away from the label. to do this, add a container div to the label and input, and add position:relative; to it. Then add the following code to the input itself:
position:absolute;
top:0; left:0;
visibility: hidden;
opacity: 0;

Resources