Search Results

Search found 131 results on 6 pages for 'centering'.

Page 1/6 | 1 2 3 4 5 6  | Next Page >

  • CSS Centering Issue - Div Centering appx 15px too far to the right

    - by Sootah
    I have a theme that I'm modifying for my site. I currently have it live on my test domain while I tinker with it before launch. http://www.networkgenius.org The #content-wrap div is centering, but too far to the right for some reason. I've absolutely no idea why it's doing this, especially since everything else is centering properly. What is the problem? I did add a 15px padding to the content-wrap area as I've changed the body's background color to the grey that you see and obviously didn't want the text pressed right up against the edges of the wrapper. Thanks for your help! -Sootah

    Read the article

  • Raphael js text positioning: centering text in a circle

    - by j-man86
    Hey everyone, I am using Raphael js to draw circled numbers. The problem is that each number has a different width/height so using one set of coordinates to center the text isn't working. The text displays differently between IE, FF, and safari. Is there a dynamic way to find the height/width of the number and center it accordingly? Here is my test page: http://jesserosenfield.com/fluid/test.html and my code: function drawcircle(div, text) { var paper = Raphael(div, 26, 26); //<< var circle = paper.circle(13, 13, 10.5); circle.attr("stroke", "#f1f1f1"); circle.attr("stroke-width", 2); var text = paper.text(12, 13, text); //<< text.attr({'font-size': 15, 'font-family': 'FranklinGothicFSCondensed-1, FranklinGothicFSCondensed-2'}); text.attr("fill", "#f1f1f1"); } window.onload = function () { drawcircle("c1", "1"); drawcircle("c2", "2"); drawcircle("c3", "3"); }; Thanks very much!

    Read the article

  • CSS, Centering an absolute <div> withing a 100% width <div>

    - by blackessej
    This shouldn't be hard...I have a menu and some content wrapped in a centered, liquid div. The content is positioned absolute. All I want to do is center #content-container. What am I missing here? #wrapper { max-width:100%; min-width:600px; min-height:100%; margin:0 auto; } #header { -moz-background-clip:border; -moz-background-origin:padding; -moz-background-size:auto auto; background-attachment:scroll; background-color:transparent; background-image:url(images/KMIAFS_banner.jpg); background-position:center top; background-repeat:no-repeat; height:150px; } #menu { margin-top:150px; clear:left; float:left; padding:0; border-top:6px solid #336699; width:100%; overflow:hidden; } #menu ul { float:left; margin:0; padding:0; list-style:none; position:relative; left:50%; text-align:center; } #menu ul li { display:block; float:left; list-style:none; margin:0; padding:0; position:relative; right:50%; } #menu ul li a { display:block; float:left; margin:0 1px 0 0; padding:30px 10px 6px 10px; background:#336699; text-decoration:none; color:#fff; } #menu ul li a:hover { padding:35px 10px 6px 10px; } #menu ul li.active a, #menu ul li.active a:hover { padding:40px 10px 6px 10px; } #content-container { top:225px; position:absolute; margin:0 auto; width:1000px; background-color:#fff; } #content { clear:left; float:left; width:610px; padding:20px 0; margin:0 0 0 30px; display:inline; } #content h2 { margin:0; } #aside { float:right; width:290px; padding:20px 0; margin:0 20px 0 0; display:inline; } #aside h3 { margin:0; } <div id="wrapper"> <div id="header"> <a id="box-link" href="index.html"></a> <div id="menu"> <ul> <li><a href="" title="Link01">Link01/a></li> <li><a href="" title="Link02">Link02</a></li> <li><a href="" title="Link03">Link03</a></li> <li><a href="" title="Link04">Link04</a></li> <li><a href="" title="Link05">Link05</a></li> <li><a href="" title="Link06">Link06</a></li> <li><a href="" title="Link07">Link07</a></li> <li><a href="" title="Link08">Link08</a></li> </ul> </div> <div id="content-container"> <div id="content"> <h2> Page heading </h2> <p> Lorem ipsum dolor sit amet consect etuer adipi scing elit sed diam nonummy nibh euismod tinunt ut laoreet dolore magna aliquam erat volut. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. </p> <p> Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </p> <p> Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. </p> </div> <div id="aside"> <h3> Aside heading </h3> <p> Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan. </p> </div> </div>

    Read the article

  • CSS centering text between two images

    - by David Lively
    I need to display two images and some text like so: ------------------------------------------ img1--------some centered text-------img2 ------------------------------------------ img1 and img2 are not the same dimensions, but their widths are very close The text is variable depending on the page in which it is displayed, and may include two lines instead of one. The text needs to centered horizontally between the two images, or between the outside of the container (either will be fine) the text AND the images need to be centered vertically within the container. I can do this VERY easily with a table, but I'd rather not retreat to that for layout. The position:inline-block and display:table-cell attributes work great in some browsers, but I need to support IE6+.

    Read the article

  • Tikz: horizontal centering of group of nodes

    - by mindhex
    Hi, I need to align each row of the graph to the center. I am trying to do it with xshift. Here the code: \begin{tikzpicture}[node distance=1.5cm, auto, text centered] \tikzstyle{every node}=[draw,ball,align=center]; \begin{scope}[xshift=1.5cm] \node (A) {A}; \node [right of=A] (B) {B}; \node [right of=B] (C) {C}; \node [right of=C] (D) {D}; \end{scope} \begin{scope}[yshift=-1.5cm] \node (AB) {AB}; \node [right of=AB] (AC) {AC}; \node [right of=AC] (AD) {AD}; \node [right of=AD] (BC) {BC}; \node [right of=BC] (BD) {BD}; \node [right of=BD] (CD) {CD}; \end{scope} \begin{scope}[yshift=-3cm,node distance=2cm,xshift=1cm] \node (ABC) {ABC}; \node [right of=ABC] (ABD) {ABD}; \node [right of=ABD] (ACD) {ACD}; \node [right of=ACD] (BCD) {BCD}; \end{scope} \begin{scope}[xshift=4cm, yshift=-4.5cm, node distance=2cm] \node (ABCD) {ABCD}; \end{scope} \end{tikzpicture} Is there any other way to do it? Do not like to change xshift values every time.

    Read the article

  • Strange centering problem in Firefox and IE8

    - by Davy8
    The navigation bar on my site http://hungryathome.net doesn't center properly on Firefox and IE8 Standards mode. It centers properly in IE7 Compatability mode and in Chrome. What's odd is that setting a Margin on the div (id="navlinks") to 4px or more will make it center properly. Any less will result in it being slightly off-center. I changed the values back and forth in Firebug and it's confusing the heck out of me. Any explanation for why that's happening?

    Read the article

  • Centering Text Horizontally and Vertically in LaTeX

    - by Paul
    I would like to produce the following: a b xxxxx xxxxx 1 xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx 2 xxxxx xxxxx xxxxx xxxxx Where the blocks of 'x's are images, and 'a', 'b', '1' and '2' are text. Here are my two attempts so far: \begin{figure} \begin{center} \begin{tabular}{ccc} & a & b \\ 1 & \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} & \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} \\ 2 & \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} & \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} \\ \end{tabular} \end{center} \end{figure} Which produces: a b xxxxx xxxxx xxxxx xxxxx 1 xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx 2 xxxxx xxxxx And \begin{figure} \begin{center} \begin{tabular}{m{1cm}m{6cm}m{6cm}} & a & b \\ 1 & \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} & \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} \\ 2 & \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} & \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} \\ \end{tabular} \end{center} \end{figure} Which produces: a b xxxxx xxxxx 1 xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx 2 xxxxx xxxxx xxxxx xxxxx

    Read the article

  • Centering in IE5/6/7/8, and FF

    - by splatto
    I'm trying to centre the content of a div such that the display is correct in IE 5,6,7 and 8, as well as FF. <div id="YoutubeClip"> <h3>Subscribe on YouTube!</h3><br> <ul class="gallery clearfix"><a href="http://www.someyoutubevideo.com" rel="prettyPhoto" title="Some youtube title"><img alt="some youtube title" src="youtube clip image" border="0"></a></ul> Some youtube title </div> As expected, this displays the image and the text centered in FF. In IE5, the image is left justified. The text is also left justified, with only one word on a line. It appears like this. IE 6 has the same problem as above. IE 7 appears to have the same problem, but when I put a border around the div, the content overflows the border. The display appears correct in IE8 Any help into this would be great. I'm trying to learn CSS better and I haven't been able to figure out the intricacies of this issue yet.

    Read the article

  • Shrinking image by 57% and centering inside css structure

    - by Johua
    Hy, i'm really stuck. I'll go step by step and hope to make it short. This is the html structure: <li class="FAVwithimage"> <a href=""> <img src="pics/Joshua.png"> <span class="name">Joshua</span> <span class="comment">Developer</span> <span class="arrow"></span> </a> </li> Before i paste the css classes, some info about the exact goal to accomplish: Resize the picture (img) by 57%. If it cannot be done with css, then jquery/javascript solution. For example: Original pic is 240x240px, i need to resize it by 57%. That means that a pic of 400x400 would be bigger after resizing. After resizing, the picture needs to be centered vertical&horizontal inside a: 68x90 boundaries. So you have an LI element, wich has an A element, and inside A we have IMG, IMG is resized by 57% and centered where the maximum width can be of course 68px and maximum height 90px. No for that to work i was adding a SPAN element arround the IMG. This is what i was thinking: <li class="FAVwithimage"> <a href=""> <span class="picHolder"><img src="pics/Joshua.png"></span> <span class="name">Joshua</span> <span class="comment">Developer</span> <span class="arrow"></span> </a> </li> Then i would give the span element: display:block and w=68px, h=90px. But unforunatelly that didn't work. I know it's a long post but i'v did my best to describe it very simple. Beneath are the css classes and a picture to see what i need. li.FAVwithimage { height: 90px!important; } li.FAVwithimage a, li.FAVwithimage:hover a { height: 81px!important; } That's it what's relevant. I have not included the classes for: name,comment,arrow And now the classes that are incomplete and refer to IMG. li.FAVwithimage a span.picHolder{ /*put the picHolder to the beginning of the LI element*/ position: absolute; left: 0; top: 0; width: 68px; height: 90px; diplay:block; border:1px solid #F00; } Border is used just temporary to show the actuall picHolder. It is now on the beginning of LI, width and height is set. li.FAVwithimage span.picHolder img { max-width:68px!important; max-height:90px!important; } This is the class wich should shrink the pic by 57% and center inside picHolder Here I have a drawing describing what i need:

    Read the article

  • Vertical-centering and overflow Excel-style in CSS?

    - by Eric Grange
    Is there a way to perform a vertical centering of a variable-sized multi-line content within a fixed-size div, with hidden overflow? The aim would be to reproduce what you can see in Excel cells: when the content fits the container, it should be vertically centered, when it is larger, the parts that overflow should be hidden (and the content still vertically aligned), like in an Excel cell whose neighbours aren't empty. I know how to vertically center using CSS, I know how to hide overflow when the content isn't vertically centered, but I've no idea how to do both at the same time... Is Javascript the only answer? The trick is that CSS positioning approaches don't work with variable-sized content (my content is dynamic text), and when you use display:table-cell, it effectively disables CSS overflow control (and the container grows to accomodate the content).

    Read the article

  • Centering contentplaceholders

    - by gh9
    I have a contentplaceholder which needs to be centered (as close to absolute as possible) to the center of the page. The issue I am having is when, the browser moves to different resolutions the centering is thrown off. I have tried using divs and tables. I have switched out the precent with em units, and still no workie. Any help would be greatly appreciated. My end goal is to have the contentplaceholder always be in the center of page regardless of the resolution of the monitor <div style="width:20%"/> <div style="width:60"> contentplaceholercode </div> <div style="width:20%"/> <table> <tr > <td style="width:20%"> </td> <td style="width:60> </td> <td style="width:20%"> </td> </tr> </table> code for master and code for content page <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Master.master.cs" Inherits="WorkRecordr.Master" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <script src="Assets/Scripts/Jqeury1.4.4.js" type="text/javascript"></script> <title></title> <style type="text/css"> body { background-color: #326598; } .outer { width: 100%; border: solid 1px gray; padding: 1px; } .inner { border: solid 1px gray; width: 70%; margin-left: auto; margin-right: auto; } </style> </head> <body> <div style="text-align: center"> <asp:ContentPlaceHolder ID="head" runat="server"> </asp:ContentPlaceHolder> </div> <form id="form1" runat="server"> <div class="outer"> <div class="inner"> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> </div> </div> </form> </body> </html> <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="WorkRecordr.test" MasterPageFile="~/Master.Master" %> <asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> aaaaaaaaa***aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa***aaaaaaaaaaaaaaaa </asp:Content>

    Read the article

  • CSS: Centering a floated block level element in IE6 (It almost works)

    - by Louis W
    I have a block level element which I am centering on the page. I have gotten it to work for all other browsers except IE6 where it ALMOST works. http://tinyurl.com/28sh9eq If I view the page in IE6 the red box is slightly off center of the pink one in IE. If I then resize the browser window it snaps into place where I want it. Uhhhhh.... yea.... what gives? How come resizing the window makes it work? I have also tried setting an explicit width on the wrapper with no avail. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=7" /> <style type="text/css"> BODY { text-align: center; font-family: Arial; } .row_wrap { height: 100px; margin-bottom: 30px; background-color: pink; } .row { float: right; position: relative; left: -50%; text-align: left; clear: both; } .button1 { color: #FFF; height: 36px; text-decoration: none; position: relative; padding: 0 30px; background: url('button.gif') no-repeat 0 0; display: block; float: left; left: 50%; } .button1 .end { width: 20px; height: 37px; position: absolute; right: -2px; top: 0; background: url('button.gif') no-repeat right 0; } .button1 .text { font-size: 16px; font-weight: bold; white-space: nowrap; height: 36px; padding-top: 7px; display: block; float: left; } .button1 .text .arrow { vertical-align: 1px; } </style> </head> <body> <h2>RTL: Button 1</h2> <div class="row_wrap"> <div class="row" dir="rtl"> <a href="#" class="button1"> <span class="end"></span> <span class="text"><span class="arrow">»</span> Hello 1.</span> </a> </div> </div> <h2>RTL: Button 1-2</h2> <div class="row_wrap" style="width: 400px;"> <div class="row" dir="rtl"> <a href="#" class="button1"> <span class="end"></span> <span class="text"><span class="arrow">»</span> Hello 1.</span> </a> </div> </div> <br/><br/> <h2>Normal: Button 1</h2> <div class="row_wrap"> <div class="row"> <a href="#" class="button1"> <span class="end"></span> <span class="text"><span class="arrow">»</span> Hello.</span> </a> </div> </div> </body> Thanks for your help.

    Read the article

  • using CSS to center FLOATED input elements wrapped in a DIV

    - by Tim
    There's no shortage of questions and answers about centering but I've not been able to get it to work given my specific circumstances, which involve floating. I want to center a container DIV that contains three floated input elements (split-button, text, checkbox), so that when my page is resized wider, they go from this: ||.....[ ][v] [ ] [ ] label .....|| to this ||......................[ ][v] [ ] [ ] label.......................|| They float fine, but when the page is made wider, they stay to the left: ||.....[ ][v] [ ] [ ] label .......................................|| If I remove the float so that the input elements are stacked rather than side-by-side: [ ][v] [ ] [ ] label then they DO center correctly when the page is resized. SO it is the float being applied to the elements of the DIV#hbox inside the container that is messing up the centering. Is what I want to do impossible because of the way float is designed to work? Here is my DOCTYPE, and the markup does validate at w3c: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> Here is my markup: <div id="term1-container"> <div class="hbox"> <div> <button id="operator1" class="operator-split-button">equals</button> <button id="operator1drop">show all operators</button> </div> <div><input type="text" id="term1"></input></div> <div><input type="checkbox" id="meta2"></input><label for="meta2" class="tinylabel">meta</label></div> </div> </div> And here's the (not-working) CSS: #term1-container {text-align: center} .hbox {margin: 0 auto;} .hbox div {float:left; } I have also tried applying display: inline-block to the floated button, text-input, and checkbox; and even though I think it applies only to text, I've also tried applying white-space: nowrap to the #term1-container DIV, based on posts I've seen here on SO. And just to be a little more complete, here's the jQuery that creates the split-button: $(".operator-split-button").button().click( function() { alert( "foo" ); }).next().button( { text: false, icons: { primary: "ui-icon-triangle-1-s" } }).click( function(){positionOperatorsMenu();} ) })

    Read the article

  • CSS / HTML centering a textbox

    - by Robert
    This should be easy but its proving difficult... My element I want centred is exactly this <input type="text"> I don't want the text centred, just the text box within the outer div. This is my attempt which is not working <div class ="temp123"> <input type="text" /> </div> Where: .temp123 { margin: 0 auto; margin-left: auto; margin-right: auto; } The text box remains on the left. The outer div has a fixed with of 300px and itself is centered using margin: 0 auto;

    Read the article

  • Centering Div in the middle of the page

    - by shinjuo
    What is the best way to center the entire page in the middle of the web browser? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>test.html</title> <style type="text/css"> .testimonials_png { position: absolute; left:20px; top:397px; width:220px; height:395px; background: url("test_files/testimonials.png") no-repeat; } .homeLink_png { position: absolute; left:-1px; top:243px; width:203px; height:75px; background: url("test_files/homeLink.png") no-repeat; } .sidingLink_png { position: absolute; left:202px; top:243px; width:180px; height:75px; background: url("test_files/sidingLink.png") no-repeat; } .windowsLink_png { position: absolute; left:382px; top:243px; width:181px; height:75px; background: url("test_files/windowsLink.png") no-repeat; } .roofingLink_png { position: absolute; left:563px; top:243px; width:183px; height:75px; background: url("test_files/roofingLink.png") no-repeat; } .aboutLink_png { position: absolute; left:746px; top:243px; width:205px; height:75px; background: url("test_files/aboutLink.png") no-repeat; } .banner_png { position: absolute; left:0px; top:0px; width:950px; height:243px; background: url("test_files/banner.png") no-repeat; } </style> </head> <body> <div class="testimonials_png"> </div> <div class="homeLink_png"> </div> <div class="sidingLink_png"> </div> <div class="windowsLink_png"> </div> <div class="roofingLink_png"> </div> <div class="aboutLink_png"> </div> <div class="banner_png"> </div> </body> </html>

    Read the article

  • Centering a percent-based div

    - by Sarfraz
    Hello, Recently, a client asked that his site be percent-based rather than pixel-based. The percent was to be set to 80%. As you guys know, it is very easy to center the container if it is pixel-based but how do you center a percent-based main container? #container { width:80%; margin:0px auto; } That does not center the container :(

    Read the article

  • Table is centering by itself?

    - by user146780
    I have a page here: http://animactions.ca/Animactions/accueil.php and it has a right column. When the right column's content is longer than then the main content, the main content centers rather than start at the top despite I defining it in a style not to do so. From my style sheet: .tbsyles { margin: 0px; text-align: justify; width: 200px; border-left-style: solid; border-left-width: 1px; border-left-color: #A8CFE4; padding-left: 30px; height: 100%; line-height: 100%; vertical-align: top; padding-right: 0px; } .tablestylea { width: 900px; margin: 0px; text-align: justify; height: 100%; line-height: 100%; vertical-align: top; padding-right: 0px; } How can I make it so no matter what the length of my right col content the main content page resizes correctly and starts from the top rather than from the center? Thanks

    Read the article

  • Programmatically Centering UIViews

    - by David Foster
    I've seen a bunch of similar questions to this, but nothing seems to be completely what I'm looking for. Do forgive me if I have missed the solution answered in another question, though! Right. I have a view. 160 pixels both tall and wide. I know that this view is going to be used as a subview, and I know that it always needs to be centered about both axis in whatever situation it's used. If defining the view programmatically, how can I be sure that it is always perfectly centered, horizontally and vertically, relative to its superview? So far, all I have is this simple code: - (void)loadView { self.view = [[UIView alloc] initWithFrame:CGRectMake(80, 150, 160, 160)]; self.view.backgroundColor = [UIColor greenColor]; self.view.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin); [self.view release]; } This does the centralization, but only in the simplest of cases. Any insight is greatly appreciated.

    Read the article

  • CSS vertical centering split background image not overlapping

    - by user295292
    is it possible to split 2 images vertically and when resizing the browser, it wont overlap but stay vertically centered? can the left image stay fixed so the right side of it won't cut off(overlap) this is what i have now, but when resizing the browser smaller, it pushes the left image underneath the right. rather have the images cut off on the outer sides and never overlap each other in the middle, make sense? #wrapper { width:1680px; max-width:1680px; height:500px; margin: 0 auto; } #left-image { width: 50%; position:absolute; left: auto; height:500px; } #right-image { width: 50%; position:absolute; right: 0px; height:500px; }

    Read the article

  • CSS vertcial centering split background image not overlapping

    - by user295292
    is it possible to split 2 images vertically and when resizing the browser, it wont overlap but stay vertically centered? can the left image stay fixed so the right side of it won't cut off(overlap) this is what i have now, but when resizing the browser smaller, it pushes the left image underneath the right. rather have the images cut off on the outer sides and never overlap each other in the middle, make sense? wrapper { width:1680px; max-width:1680px; height:500px; margin: 0 auto; } left-image { width: 50%; position:absolute; left: auto; height:500px; } right-image { width: 50%; position:absolute; right: 0px; height:500px; }

    Read the article

  • JQuery Datatable Question: Centering column data after data insertion

    - by Chris
    I have a data table that is initially empty and is populated after a particular Javascript call. After the data is inserted into the table, I'd like to center all of the data in one of the columns. I tried specifying this at the initialization step in this way: dTable = $('#dt').datatable({ 'aoColumns': [ null, null, { "sClass" : "center" }] }); The data in the third column was not centered after the insertions were complete. I tried modifying aoColumns after the insertions and redrawing the table as well: dTable.fnSettings().aoColumns[2].sClass = "center"; dTable.fnDraw(); This did not work either. So my question is simply how should I go about telling the data table to center the data in the third column? Thanks in advance for your suggestions. Chris

    Read the article

  • Vertical centering text (jQuery)

    - by Nimbuz
    <div style="width: 100px; height:50px; line-height:50px; overflow:hidden;"> <p>A short line</p> </div> <div style="width: 100px; height:50px; line-height:50px; overflow:hidden;"> <p>A really really really long line</p> </div> Wrapped text in the second example gets cut off because of the line-height:50px which should be 25px in this case. How do I use jQuery to find if theres single or multi-line text in an element? Thanks!

    Read the article

  • Re-Centering JQuery Tooltips when resizing the window

    - by leeand00
    I have written a function that positions a tooltip just above a textbox. The function takes two arguments: textBoxId - The ID of the textbox above which the tooltip will appear. Example: "#textBoxA" toolTipId - The ID of the tooltip which will appear above the textbox. Example: "#toolTipA" function positionTooltip(textBoxId, toolTipId){ var hoverElementOffsetLeft = $(textBoxId).offset().left; var hoverElementOffsetWidth = $(textBoxId)[0].offsetWidth; var toolTipElementOffsetLeft = $(toolTipId).offset().left; var toolTipElementOffsetWidth = $(toolTipId)[0].offsetWidth; // calcluate the x coordinate of the center of the hover element. var hoverElementCenterX = hoverElementOffsetLeft + (hoverElementOffsetWidth / 2); // calculate half the width of the toolTipElement var toolTipElementHalfWidth = toolTipElementOffsetWidth / 2; var toolTipElementLeft = hoverElementCenterX - toolTipElementHalfWidth; $(toolTipId)[0].style.left = toolTipElementLeft + "px"; var toolTipElementHeight = $(toolTipId)[0].offsetHeight; var hoverElementOffsetTop = $(textBoxId).offset().top; var toolTipYCoord = hoverElementOffsetTop - toolTipElementHeight; toolTipYCoord = toolTipYCoord - 10; $(toolTipId)[0].style.top = toolTipYCoord + "px"; $(toolTipId).hide(); $(textBoxId).hover( function(){ $(toolTipId + ':hidden').fadeIn(); }, function(){ $(toolTipId + ':visible').fadeOut(); } ); $(textBoxId).focus ( function(){ $(toolTipId + ':hidden').fadeIn(); } ); $(textBoxId).blur ( function(){ $(toolTipId+ ':visible').fadeOut(); } ); } The function works fine upon initial page load: However, after the user resizes the window the tooltips move to locations that no longer display above their associated textbox. I've tried writing some code to fix the problem by calling the positionTooltip() function when the window is resized but for some reason the tooltips do not get repositioned as they did when the page loaded: var _resize_timer = null; $(window).resize(function() { if (_resize_timer) {clearTimeout(_resize_timer);} _resize_timer = setTimeout(function(){ positionTooltip('#textBoxA', ('#toolTipA')); }, 1000); }); I'm really at a loss here as to why it doesn't reposition the tooltip correctly as it did when the page was initially loaded after a resize.

    Read the article

  • Centering a div block without the width

    - by Vinicius
    Hi, I have a problem when I try to center the div block "products" because I don't know in advance the div width. Anybody have a solution? Update: The problem I have is I don't know how many products I'll display, I can have 1, 2 or 3 products, I can center them if it was a fixed number as I'd know the width of the parent div, I just don't know how to do it when the content is dynamic. <style> .product_container { text-align: center; height: 150px; } .products { height: 140px; text-align: center; margin: 0 auto; clear: ccc both; } .price { margin: 6px 2px; width: 137px; color: #666; font-size: 14pt; font-style: normal; border: 1px solid #CCC; background-color: #EFEFEF; } </style> <div class="product_container"> <div class="products" id="products"> <div id="product_15"> <img src="/images/ecommerce/card_default.png"> <div class="price">R$ 0,01</div> </div> <div id="product_15"> <img src="/images/ecommerce/card_default.png"> <div class="price">R$ 0,01</div> </div> <div id="product_15"> <img src="/images/ecommerce/card_default.png"> <div class="price">R$ 0,01</div> </div> </div> </div>

    Read the article

1 2 3 4 5 6  | Next Page >