alignment

How do I center a <div>? [duplicate]

和自甴很熟 提交于 2019-12-30 17:45:22
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: How to center DIV in DIV? I want to center a <div> (I'm new to HTML5 and the <center> tag is no more), and by all means avoid using a table. This is what I've got as CSS for the <div> in question so far: #roundedcorner { -moz-border-radius: 15px; border-radius: 15px; background-image: url(file:///Macintosh%20HD/Users/julesmazur/Desktop/TAN3.0/Photos/bodydivbg.png); width: 960px; left: 50%; font-family: Ubuntu; }

JTabbedPane: tab placement set to LEFT but icons are not aligned

不羁岁月 提交于 2019-12-30 13:51:27
问题 I have a JTabbedPane with tab placement set to LEFT. The problem is that icons in each tab are not vertically aligned with one another. Consider this picture: As you can see the icon of "Editar Protocolo" (second tab) is not perfectly aligned with the icon of "Distribuir Protocolo" (first tab) and this also happen with the other tabs. I want all icons be vertically aligned to the left. This is the code I'm using to set tab components: ... jtabbedPane.setTabComponentAt(1, configurarJtabbedPane

WPF TreeView with right alignment values

前提是你 提交于 2019-12-30 10:57:21
问题 I have a problem with my wpf treeview. It's code goes like this: <TreeView ItemsSource="{Binding Path=Items}" Grid.RowSpan="2" Grid.ColumnSpan="2"> <TreeView.Resources> <HierarchicalDataTemplate DataType="{x:Type m:MyTreeItem}" ItemsSource="{Binding Items}"> <DockPanel LastChildFill="True"> <TextBlock Text="{Binding Path=Value}" DockPanel.Dock="Right"/> <TextBlock Text="{Binding Path=Display}" DockPanel.Dock="Left"/> </DockPanel> </HierarchicalDataTemplate> </TreeView.Resources> </TreeView>

Aligning <li> next to each other, not working

偶尔善良 提交于 2019-12-30 09:39:11
问题 I have a problem with aligment of two li elements inside a div because in the next example HTML <div id="menu-container"> <div class="menu-left"> <ul id="menu-principal" class="menu"> <li><a href="">Hola</a></li> <li><a href="">Hola2</a></li> </ul> </div> <!-- More code --> </div> The CSS code is in the next link and I use that html structure because that is what is generated by placing a menu in wordpress. http://jsfiddle.net/Soldier/KhLhR/1/ I have a simple code with two li elements and I

How to make elements flow from bottom to top?

≯℡__Kan透↙ 提交于 2019-12-30 03:01:20
问题 Is there a way in CSS to get elements to behave like the picture on the right? The order of the elements isn't that important, but the tiles need to occupy the space from the bottom-up rather than top-down as the person resizes the page. NORMAL DESIRED |---------| |---------| | A B C D | | I | | E F G H | | E F G H | | I | | A B C D | |---------| |---------| Sample code: <html> <head> <style> .container { margin:10px; border:1px solid black; float:left; } .tile { width:100px; height:100px;

Vertical align span text inside inline-block div

戏子无情 提交于 2019-12-30 02:14:07
问题 I am building a website with a flat design. I have a header and under it two different coloured blocks next to each other. I tried float left and right but was advised to use display: inline-block instead. I ran into an issue, though. I want to place some text right in the middle of both the left and right block and tried to use the align-items: center, but figured out that only works if the div is set to flex. So my question is, can I somehow keep my inline-block and get my text centered in

Right align Facebook like button

 ̄綄美尐妖づ 提交于 2019-12-30 01:42:05
问题 I am able to put a Facebook like button on my website, but how do I make it to be right-aligned within the div / iframe it is in? I tried applying various CSS properties, but I could not get anything to move in the iframe. 回答1: iframe is an inline element, you can use text-align: right for a div that contains that iframe, or float the iframe to the right, but just make sure to clear the float afterwards. sample: http://jsfiddle.net/Mujj6/3/ and: http://jsfiddle.net/Mujj6/5/ 回答2: I think this

sizeof union larger than expected. how does type alignment take place here?

浪子不回头ぞ 提交于 2019-12-29 08:48:05
问题 #include <stdio.h> union u1 { struct { int *i; } s1; struct { int i, j; } s2; }; union u2 { struct { int *i, j; } s1; struct { int i, j; } s2; }; int main(void) { printf(" size of int: %zu\n", sizeof(int)); printf("size of int pointer: %zu\n", sizeof(int *)); printf(" size of union u1: %zu\n", sizeof(union u1)); printf(" size of union u2: %zu\n", sizeof(union u2)); return 0; } Results in: $ gcc -O -Wall -Wextra -pedantic -std=c99 -o test test.c $ ./test size of int: 4 size of int pointer: 8

Alignment of arrays in .NET

有些话、适合烂在心里 提交于 2019-12-29 07:43:07
问题 Are arrays in .NET aligned to any boundary? If yes, to which? And is it the same for all array types? 回答1: The common language infrastructure (ECMA-335) places the following restrictions on alignment: 12.6.2 Alignment Built-in data types shall be properly aligned, which is defined as follows: 1-byte, 2-byte, and 4-byte data is properly aligned when it is stored at a 1-byte, 2-byte, or 4-byte boundary, respectively. 8-byte data is properly aligned when it is stored on the same boundary

Java: vertical alignment within JPanel

烂漫一生 提交于 2019-12-29 05:06:28
问题 I am trying to vertically align (center) both JLabels inside one JPanel. JPanel panel = new JPanel(); panel.setPreferredSize(size); JLabel label1 = new JLabel(icon); JLabel label2 = new JLabel("text"); panel.add(label1); panel.add(label2); I have tried using setAligmentY() with no success. Both labels always appear on the top of JPanel. UPD: Labels should be located next to each other like using FlowLayout, but in the middle of the JPanel. 回答1: Use a GridBagLayout with the default constraints