0

Basic response page with centered content

 2 years ago
source link: https://www.codesd.com/item/basic-response-page-with-centered-content.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Basic response page with centered content

advertisements

I have a webpage and I'm using Jquery mobile.

I have an image and un text and I would like to center the content in my page horizontaly and verticaly, and when I modify the width of the window, the content should adapt.

Here is an example :

In the example, the content adapt correctly, but it's not centered. if I set the style of my content div to :

style="position: absolute; top: 0; bottom: 0; left: 0; right: 0; margin: auto;width: 500px;"

To my div, the content is centered but no longer adapt...

Can you update my jsfiddle to do what I need ?


You can work with display: table; on the outer and display:table-cell on the inner container to center stuff vertically. Check this out:

http://jsfiddle.net/NrCGb/578/

EDIT Max width 500px for content:

http://jsfiddle.net/NrCGb/585/

Related Articles

How can I burn pages with dynamic content using node.js?

I am trying to scrape a website but I don't get some of the elements, because these elements are dynamically created. I use the cheerio in node.js and My code is below. var request = require('request'); var cheerio = require('cheerio'); var url = "ht

Get the result of the PHP script of a page with HTML content by AJAX

I have a PHP page with HTML content in it. Now I run some PHP codes between HTMLs and I get some results. The fact is, when I try to get a respond from this page by AJAX it'll show me the whole page content and plus the result I was looking for. What

Force footer down on pages with little content

I have a page with only a couple of lines of content. I want the footer to be pushed to the bottom. <div id="footer"></div> I don't want to use #footer { position:fixed; bottom:0; } AKA Sticky Footer Is this possible without jQuery?

Place the div at the bottom of the page with dynamic content

I want to place a footer div at the bottom of the page. The problem is, I have a dynamic content, so I can not work with "position: fixed;". The page looks something like this: <body> <div id="container"> <div id="n

Web Scraping pages with javascript content on shared hosting

I would like to scrape web pages that load content dynamically with Javascript or similar. Something like a headless browser, that I could use on a Linux Shared Host without X. I can use PHP, Perl, Ruby or Python. Do any of you know some framework/he

Using node.js to run a basic Web page with CSS and JS elements

I am coming from a (traditional) server side scripting (PHP) background and am trying to experiment with Node to see what the fuss is all about. Objective: serve up a simple web document with some style sheets and scripts on it. My node.js script: va

ASP.NET vs. JQuery to create a Web page with dynamic content

i want to build an asp.net webpage. it will be used as a form to collect some information from user and submit it to be saved on database. content of the page controls and labels should be created dynamically. Questions of the form will be read from

The best way to fill a page with dynamic content

I have been thinking about this for some time now, for the purpose of an example lets say we have index.php which has a whole bunch of content and a search box, when a user inputs data into the search box results appear below such as images and data

Spring how to merge an external html page with generated content

Hi I am currently developing a spring (3.2.x) application where I have to insert my content into a given page at a certain point specified by an id. This is what I am currently doing: @RequestMapping(value = "/{part}", method = RequestMethod.POS

Sensitive circle with centered content

Is there a way to make the following: #id { border-radius: 100px; width: 100px; height: 100px; } <div id="circle"> <h3>Hello</h3> </div> A round div with the text centered vertically and horizontally. At the same time kee

read the web page (with dynamic content) and save

Im using file_get_contents() and the source is a url. Im also using ajax to insert html into the page. The page when loaded: <div> <!-- Html goes here when the insert button is pressed --> <input type="button" onclick="insert

How to publish to the Facebook page with multimedia content using Node JS

I'm trying to make an auto post to my Facebook page from my server, I'm using Nodejs and Facebook-node-sdk. My problem is that i'm not able to add an image and I don't know how to upload a video using this package. this is my code to post on my page

How to load the HTML page with javascript content in a WebView Xamarin.Forms?

I am new in xamarin and c# forms platform. I make a simple webview application. and my main page is namespace jsinjection { public class WebviewPage : ContentPage { public WebviewPage () { Content = new WebView { Source = "https://www.google.com.tr/&

The iframe html page with flash content creates a problem for the drop-down menu

I have an iframe to a page where a Flash swf file is running; does anybody have an idea how to make it transparent so that my drop-down menu should be shown perfectly? Kindly be informed I can't edit the source page (add param = wmode, value = transp

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK