Wednesday 15 September 2010

html - button ignores parent div and won't align -


I can not find enough under this: It seems that my parents div is being ignored by the browser Hopefully when I want to align it, any of you can get it! Thanks!

This is my parent div:

  # button-subtitles {height: auto; Width: Auto; Text align: center; Margin-left: auto; Margin-right: auto; }   

And this is my child:

 . Button, button {color: #fff! Important; Font-size: -63px; Font-Family: "Central Sense-Bold", "Helvetia New", Helvetica, Ariel; Line-height: 265%; Text-decoration: None; Background color: # 167de4; Padding: 0 20px; Status: Completed; -Vibit-boundary-radius: 3px; -max-boundary-radius: 3px; -mms-boundary-radius: 3px; -o-radius-radius: 3px; Boundary-radius: 3px; -Webbit-background-clip: padding; -move-background-clip: padding; Limit: 1px solid # 1d4ea4; -Moz-box-shadow: 0 1px 1px rgba (0,0,0,0.23), inset 0 1px 0 rgba (255,255,255,0.1.19); Background image: -Winkit-gradient (linear, 50% 100%, 50% 0%, color-stop (0%, # 3669 FA), color-stop (100%, # 4f95f4)); Background image: -webkit-linear-shield (bottom, # 3669ef 0%, # 4f95f4 100%); Background image: -Mo-linear-gradient (bottom, # 3669ef 0%, # 4f95f4, 100%); Background image: -o-linear-gradient (bottom, # 3669ef 0%, # 4f95f4 100%); Background image: Linear-gradient (bottom, # 3669ef 0%, # 4f95f4 100%); Text-shadow: 0 1 px 2 px rgba (0,0,0,0.//.75); White-space: Abrop; Text-overflow: oval; }   

When I try to apply it to HTML then it gets stuck on the left side of the screen:

     

Here are two answers already, and even choose But I think I'll share my alternative solution in any way, so there are more options available to you.

The way I solved this, a line of CSS was changed under it. Display button, button style, twist status: full to : inline-block . The whole situation can be very difficult to work properly in the layout because it basically removes the element from the "flow" of the HTML.

In addition, I think that can be helpful for you. Another small thing is to use an anchor (A) element for the button instead of an anchor, because clicking on the anchor gives you Will bring in specified href.

Here's a JSFiddle:

Regardless, you're happy to answer your question!

No comments:

Post a Comment