ddsmoothmenu not working with arrow keys on the keyboard.
when li list is so long this goes below the page so unable to click on li. So how do I handle this issue?
ddsmoothmenu.init({
mainmenuid: "divMenu", //menu DIV id
orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
classname: 'ddsmoothmenu', //class added to menu's outer DIV
contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})
<div align="left" id="tdmenu">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="75%">
<div id="divMenu" class="ddsmoothmenu">
<ul>
<li>
Home
</li>
<asp:Literal runat="server" ID="ltMenu"></asp:Literal>
<li runat="server" id="divProSupportTicket" visible="false">
<a href="javascript:showWindow('supportticket.aspx',900,600,100)">
<img src="images/support.png" alt="Software Support Form" height="20" title="Software Support Form" />
</a>
</li>
<li>
<div id="HelpIcon" style="border: solid 1px gray; background-color: #4C83F8; border-radius: 50%; cursor: pointer; width: 25px; margin-left: 10px; margin-top: 2px;" title="Help Information" onclick="showHelp('home_Vehicle');">
<span style="font-size: 20px; color: White; font-weight: bold; padding: 0px 7px 0px 7px;">
<i>i</i>
</span>
</div>
</li>
<li runat="server" id="liCompanyContacts" visible="false"></li>
</ul>
</div>
</td>
</tr>
</table>
</div>
Related
I am in the process of developing a BootStrap wrapper for an ASP.NET website that works with almost everything I have used in it -- with the only exception being that content in the main panel does not center itself properly when shrinking the browser window's width, despite the header and footer being completely responsive.
I have a fiddle for this problem: https://dotnetfiddle.net/6dmcaX.
PLEASE NOTE that this wrapper is applied to the master page, and not directly onto the pages that I'm testing with.
For the header, I use a div with the following class attributes: d-flex justify-content-center flex-md-rows align-items-center shadow-sm border-menus fixed-top. Inside that is an UpdatePanel and ContentTemplate, with holds a bunch of markup for the BootStrap navbar.
Meanwhile, here is the markup for the main content panel:
<div class="container d-flex justify-content-center flex-md-rows align-items-center">
// the container acts the same with or without the text to the right of "d-flex"
<div id="content" class="row" style="margin-left: auto; margin-right: auto;">
<div id="divContMain" runat="server" style="width: auto;">
<asp:UpdatePanel ID="contentUPanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<center>
<asp:ContentPlaceHolder ID="MainContent" runat="server" />
</center>
</ContentTemplate>
</asp:UpdatePanel>
</div>
…
</div>
</div>
The container divContMain needs to run on the server because just below the main content is a sidebar which may or may not be needed, depending on the page being called. By default, the class for divContMain is col-12. One thing I tried doing to fix this problem was I changed the main container to a container-fluid and changed divContMain's width to be inherited instead of "auto" -- and while this did a better job keeping contents in the center, it eventually stops working once the window gets small enough.
I'm very close to figuring this one out, but I wanted to ask and see if anyone else knew. Any help would be appreciated!
It is possible to use combination of the Bootstrap classes to justify content when display: flex is used:
d-flex justify-content-center
So you can add new css class for h1:
#MainContent_ctl00 > h1 {
text-align: center;
}
and add d-flex justify-content-center styles for div which contains your table:
<div class="container d-flex justify-content-center" style="overflow-x: visible;">
<table class="datatable datatable-striped"
id="MainContent_dgReqs" style="border-collapse:collapse;"
border="1" rules="all" cellspacing="0" cellpadding="5">
<!-- The other code is omitted for the brevity -->
</table>
</div>
In addition, text can be aligned through text-align: center inside of <h1>.
An example:
.tableint {
font-size: 15px;
font-family: Estrangelo Edessa, Verdana;
border: Solid 1px #666666;
border-collapse: collapse;
color: Black;
}
.thint {
background-color: #EE8322;
color: Black;
font-weight: bold;
font-size: 14px;
border: solid 1px #666666;
border-collapse: separate;
font-variant: small-caps;
margin-bottom: 5px;
}
.textboxint {
background-repeat: repeat-x;
border: 1px solid #d1c7ac;
font-size: 14px;
border-style: inset;
margin-right: 5px;
margin-bottom: 5px;
margin-top: 5px;
font-family: Estrangelo Edessa, Verdana;
color: Black;
width: 175px;
}
.dropdownint {
background-repeat: repeat-x;
border: 1px solid #d1c7ac;
font-size: 12px;
border-style: inset;
margin-right: 5px;
margin-bottom: 5px;
margin-top: 5px;
font-family: Estrangelo Edessa, Verdana;
color: Black;
width: 175px;
}
.buttonint {
margin: 5px;
font-family: Estrangelo Edessa, Verdana;
font-size: 14px;
background-color: #EE8322;
color: Black;
text-align: center;
border-top-style: groove;
border-left-style: groove;
border-right-color: Black;
border-bottom-color: Black;
height: 22px;
}
.buttonint:hover {
font-family: Estrangelo Edessa, Verdana;
font-size: 14px;
background-color: #FFFFCC;
color: #006699;
margin: 5px;
}
#MainContent_ctl00 > h1 {
text-align: center;
}
<div class="container-fluid my-hs d-flex justify-content-center flex-md-rows align-items-center">
<div class="row justify-content-center" id="content"
style="margin-left: auto; margin-right: auto; padding-top: 1rem;">
<!-- <div id="divContMain" style="width: inherit;">may just remove -->
<div id="contentUPanel">
<div id="MainContent_ctl00">
<br>
<h1>Purchasing Requisitions</h1>
<br>
<div>
<table width="325" align="center" class="tableint" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td align="center" class="thint" colspan="2">Filter</td>
</tr>
<tr>
<td align="left" style="width: 50%">Request Start:</td>
<td align="left" style="width: 50%">
<input class="textboxint" style="width:175px;" type="text">
</td>
</tr>
<tr>
<td align="left" style="width: 50%">Request End:</td>
<td align="left" style="width: 50%">
<input class="textboxint" style="width:175px;" type="text">
</td>
</tr>
<tr>
<td align="left" style="width: 50%">Part Number:</td>
<td align="left" style="width: 50%">
<input class="textboxint" style="width:175px;" type="text"></td>
</tr>
<tr>
<td align="left" style="width: 50%">Account:</td>
<td align="left" style="width: 50%">
<input class="textboxint" style="width:175px;" type="text"></td>
</tr>
<tr>
<td align="left" style="width: 50%">Vendor No:</td>
<td align="left" style="width: 50%">
<input class="textboxint" style="width:175px;" type="text"></td>
</tr>
<tr>
<td align="left" style="width: 50%">Vendor Name:</td>
<td align="left" style="width: 50%">
<input class="textboxint" style="width:175px;" type="text"></td>
</tr>
<tr>
<td align="center" colspan="2">
<input class="buttonint" type="submit" value="Search">
</td>
</tr>
</tbody>
</table>
</div>
<br>
<div class="container d-flex justify-content-center" style="overflow-x: visible;">
<table class="datatable datatable-striped" id="MainContent_dgReqs" style="border-collapse:collapse;"
border="1" rules="all" cellspacing="0" cellpadding="5">
<tbody>
<tr align="center" class="thint" style="color:Black;background-color:#EE8322;font-weight:bold;">
<td>Row1</td>
<td>Row2</td>
<td>Row3</td>
</tr>
<tr align="center" class="gridview">
<td>Data1</td>
<td>Data2</td>
<td>Data3</td>
</tr>
<tr align="center" class="gridview" style="background-color:#FFE1CD;">
<td>Data1</td>
<td>Data2</td>
<td>Data3</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script src=" index.js"></script>
<link rel="stylesheet" type="text/css"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js">
</script>
UPDATE:
I saw you edited your fiddle. So the items are aligned, however we need to align the above div container. So to do this, it is necessary to add the following styles:
<div class="row" id="content mx-auto" style="display:flex; justify-content: center;">
<!-- The other code is omitted for the brevity -->
</div>
With some help from StepUp, I was able to find out what exactly was going wrong. The main container needs its position set to absolute and the content group just below the container needs its content justified to the center, like this:
<div class="container-fluid mt-5" style="position: absolute;">
<div id="content" class="row" style="display: flex; justify-content: center;">
…
</div>
</div>
Now everything scales and is properly centered!
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am designing a page to be loaded on phones and iPad. I am trying to figure out how to arrange the pic as follow. 3 columns and 2 rows in container-fluid. The pic and words must resize when switching between phones and iPad. I am only displaying in portrait mode. My current code, I only specify a static height and width for all the pics but how to do it dynamically? I am also using <table> to arrange the pic and wordings, is there a better way by using div. Please help, thanks you very much.
The ideal arrangement:
My results:
JS FIDDLE DEMO
<!-- Bootstrap core CSS -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<style>
* {
box-sizing: border-box;
font-family:Arial;
font-size:12px;
}
img {
width: 100%;
}
div#form-box {
margin-top: -95px;
text-align: center;
}
div#input-group {
width: 90%;
margin: 15px auto 5px; /* top, left and right, bottom */
position: relative;
background-color: #fff;
border: none;
border-radius: 5px;
}
input#searchClasses, label[for="searchClasses"] {
display:inline-block;
vertical-align: middle;
}
input#searchClasses {
width: calc(100% - 40px);
padding: 10px;
border: none;
}
label[for="searchClasses"] {
width: 40px;
line-height: 30px;
}
button#btn-checkin {
display: inline-block;
padding: 8px 20px;
border: none;
border-radius: 5px;
background-color: #EC008c;
color: #fff;
text-align: center;
text-transform: uppercase;
}
.drop-shadow {
-webkit-box-shadow: 0 0 2px 2px rgba(0, 0, 0, .5);
box-shadow: 0 0 10px 1px rgb(211, 211, 211, 0.8);
border-radius:0px;
}
.container-fluid{
width:auto
}
.container-fluid.drop-shadow {
margin-top:2%;
margin-left:5%;
margin-right:5%
}
#content{
width:100%;
margin: auto;
text-align: center;
margin-top: 8px;
}
.form-group {
width:100%;
margin-bottom:10px;
}
.btn-plan {
display: inline-block;
height:48px;
padding: 8px 10px;
margin-bottom: 10px;
border: none;
border-radius: 10px;
background-color: #B9E5FB;
color: #000;
text-align: center;
width:95%
}
.btn-popular {
display: inline-block;
height:48px;
padding: 0px 0px;
white-space: normal;
margin-bottom: 10px;
border: none;
border-radius: 10px;
background-color: #B9E5FB;
color: #000;
text-align: center;
width:95%
}
.textUnderPic{
margin-top:2px;
text-align:center;
font-size:8px;
}
</style>
</head>
<body id="sfitness" >
<img src="https://preview.ibb.co/kJvJ5e/1847p.png" />
<div id="form-box">
<form>
<div id="input-group">
<label for="searchClasses" class="glyphicon glyphicon-search"></label><!--
--><input type="text" placeholder="Search Classes" id="searchClasses" readonly>
</div>
<br/>
<button id="btn-checkin">Check-in</button>
</form>
</div>
<div id="content">
<div class="container-fluid">
<table style="width:100%;margin-left:4%">
<tr>
<td>
<img src="https://image.ibb.co/jWX2Jz/location.png" alt="location" border="0" class="float-left" style="width:17px;height:20px"/>
</td>
<td style="padding-left:9px;padding-top:9px;width:auto;text-align:left">
<p>Current Location <b>Sri Petaling</b></p>
</td>
</tr>
</table>
</div>
<div class="container-fluid drop-shadow">
<div class="media">
<div class="media-left">
<a href="#">
<img class="media-object" src="https://preview.ibb.co/nnzPyz/7557.jpg" style="width:104px;height:64px;padding:10px 10px 5px">
</a>
</div>
<div class="media-body">
<h5 class="media-left" style="padding-top:12px;color:#B9E5fB" >PERSONAL TRAINING</h5>
<p class="pull-left" style="padding-top:3px">Strike Academy Fitness</p>
</div>
</div>
</div>
<div class="container-fluid drop-shadow" style="overflow:auto;padding:0px;margin-top:20px">
<table style="width:93%;margin:3%">
<tr>
<td colspan="3">
<p style ="padding-left:5px;padding-top:3px; width:100%;text-align:left">Plan your time</p>
</td>
</tr>
<tr>
<td style="width:33.33%">
<button class="btn-plan" >All</button>
</td>
<td style="width:33.33%">
<button class="btn-plan" >Morning</button>
</td>
<td style="width:33.33%">
<button class="btn-plan">Afternoon</button>
</td>
</tr>
<tr>
<td>
<button class="btn-plan">Evening</button>
</td>
<td>
<button class="btn-plan">Tomorrow</button>
</td>
<td>
<button class="btn-plan">This Week</button>
</td>
</tr>
</table>
</div>
<div class="container-fluid drop-shadow" style="overflow:auto;padding:0px;margin-top:20px">
<table style="width:93%;margin:3%">
<tr>
<td colspan="3">
<p style ="padding-left:5px;padding-top:3px; width:100%;text-align:left">Nearby Class starts in next 60 mins</p>
</td>
</tr>
<tr>
<td style="width:33%;align-self:center">
<div style="width:50%">
<img class="media-object" align="center" src="https://preview.ibb.co/nnzPyz/7557.jpg" alt="Generic placeholder image">
</div>
</td>
<td width="33%">
<img class="media-object" src="https://preview.ibb.co/nnzPyz/7557.jpg" style="width:104px;height:64px;padding:10px 10px 0px 5px" alt="Generic placeholder image">
</td>
<td width="33%">
<img class="media-object" src="https://preview.ibb.co/nnzPyz/7557.jpg" style="width:104px;height:64px;padding:10px 10px 0px 5px" alt="Generic placeholder image">
</td>
</tr>
<tr>
<td>
<p class="textUnderPic"><font color="#00B3F0">Gym</font>Sungai Besi</p>
</td>
<td>
<p class="textUnderPic"><font color="#00B3F0">Muay Thai</font>Sri Pinang</p>
</td>
<td>
<p class="textUnderPic"><font color="#00B3F0">Yoga</font>Serdang</p>
</td>
</tr>
<tr>
<td>
<img class="media-object" src="https://preview.ibb.co/nnzPyz/7557.jpg" style="width:104px;height:64px;padding:10px 10px 0px 5px" alt="Generic placeholder image">
</td>
<td>
<img class="media-object" src="https://preview.ibb.co/nnzPyz/7557.jpg" style="width:104px;height:64px;padding:10px 10px 0px 5px" alt="Generic placeholder image">
</td>
<td>
<img class="media-object" src="https://preview.ibb.co/nnzPyz/7557.jpg" style="width:104px;height:64px;padding:10px 10px 0px 5px" alt="Generic placeholder image">
</td>
</tr>
<tr>
<td>
<p class="textUnderPic" >Gym</font>Sungai Besi</p>
</td>
<td>
<p class="textUnderPic" >Muay Thai</font>Sri Pinang</p>
</td>
<td>
<p class="textUnderPic" >Yoga</font>Serdang</p>
</td>
</tr>
</table>
</div>
</div>
I have updated the fiddle for you. "https://jsfiddle.net/87qughpe/10/"
Some Notes:
Don't know which bootstrap you were using, I have used Bootstrap-4
Don't use table to write that structure, but rather use Boostrap Grid
Let the image expand as per width of container.
.worked-div p {
text-align: left;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" rel="stylesheet" />
<div class="container-fluid drop-shadow worked-div" style="">
<div class="row">
<div class="col-4">
<img class="img-fluid" align="center" src="https://preview.ibb.co/nnzPyz/7557.jpg" alt="Generic placeholder image">
<p>
Generic placeholder image
</p>
</div>
<div class="col-4">
<img class="img-fluid" align="center" src="https://preview.ibb.co/nnzPyz/7557.jpg" alt="Generic placeholder image">
<p>
Generic placeholder image
</p>
</div>
<div class="col-4">
<img class="img-fluid" align="center" src="https://preview.ibb.co/nnzPyz/7557.jpg" alt="Generic placeholder image">
<p>
Generic placeholder image
</p>
</div>
<div class="row">
<div class="col-4">
<img class="img-fluid" align="center" src="https://preview.ibb.co/nnzPyz/7557.jpg" alt="Generic placeholder image">
<p>
Generic placeholder image
</p>
</div>
<div class="col-4">
<img class="img-fluid" align="center" src="https://preview.ibb.co/nnzPyz/7557.jpg" alt="Generic placeholder image">
<p>
Generic placeholder image
</p>
</div>
<div class="col-4">
<img class="img-fluid" align="center" src="https://preview.ibb.co/nnzPyz/7557.jpg" alt="Generic placeholder image">
<p>
Generic placeholder image
</p>
</div>
</div>
I have this code on my TruckData page:
<!-- BEGIN SIDEBAR -->
<div class="left side-menu" style="background: #99CCFF">
<div class="body rows scroll-y" style="background: #99CCFF; margin-top: 50px; padding-top: 40px">
<!-- Sidebar menu -->
<div id="sidebar-menu">
<ul>
<li>
<asp:HyperLink ID="hyperlink_TruckData" runat="server" Text="Truck Data" NavigateUrl="~/View/TruckData.aspx" Font-Underline="false" style="font-size: 18px; color: black">
<i class="glyphicon glyphicon-info-sign" style="color:black; background: #E8D73E"></i>
Truck Data</asp:HyperLink>
</li>
<li>
<asp:HyperLink ID="hyperlink_MaintenanceRecord" runat="server" NavigateUrl="~/View/MaintenanceRecord.aspx" Font-Underline="false" style="font-size: 18px; color: black">
<i class="glyphicon glyphicon-info-sign" style="color:black"> </i>
Maintenance Record</asp:HyperLink>
</li>
<li>
<asp:HyperLink ID="hyperlink_MaintenanceSchedule" runat="server" Text="Maintenance Schedule" NavigateUrl="~/View/MaintenanceSchedule.aspx" Font-Underline="false" style="font-size: 18px; color: black">
<i class="glyphicon glyphicon-calendar" style="color:black"> </i>
Maintenance Schedule </asp:HyperLink>
</li>
<li>
<asp:hyperlink id="hyperlink_Inspection" runat="server" text="inspection" navigateurl="~/view/inspection.aspx" font-underline="false" style="font-size: 18px; color: black">
<i class="glyphicon glyphicon-calendar" style="color:black"></i>
Inspection </asp:hyperlink>
</li>
</ul>
</div><!-- End div #sidebar-menu -->
</div><!-- End div .body .rows .scroll-y -->
</div>
<!-- END SIDEBAR -->
And this is my CSS:
.row a:hover {
background-color: #6699FF;
}
.row a:active {
background-color: #;
}
.row a:visited {
background-color: #;
}
.row a:selected {
background-color: #63D130;
}
This is the output:
On the picture, only the glyphicon is highlighted. I want to highlight the whole. How can I highlight the whole Truck Data menu? In normal HTML it worked, but in ASP.Net, only the icon is highlighted.
I started writing html for e-mails using tables. Now, for first time I tried to write using divs, but this is causing a problem: I cannot center align everything I used to be able to center.
Maby what I wrote is not correct, but this is only way that I find, to be able after writing to copy everything from browser to Gmail.
Can someone to tell me how I can center align in this code?
If someone can also tell me if there are better ways to write this code I would be happy to recieve criticism and helpful information.
P.S: I tried padding, positioning, margin, put height and width, but with these options in most results HALF of my bacground or my background is going off at all.
<!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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
div#Container {
width: 895px;
height: 525px;
position: absolute;
left: 9px;
top: 15px;
}
div#Room {
padding-left: 245px;
padding-top: 80px;
width: 625px;
}
#Room span {
font-family: Times New Roman, Times, serif;
font-weight: bold;
font-size: 23px;
color: #522405;
}
#D { padding-left: 70px;
}
#GD { padding-left: 103px;
}
#GPV { padding-left: 53px;
}
div#Content {
padding-left: 245px;
padding-top: 10px;
width: 625px;
}
#Right {
position: absolute;
left: 872px;
top: 222px;
}
img.Spacer {
margin-left: 10px;
}
div.content {
font-family: Arial, Helvetica, sans-serif;
color: black;
font-size: 17px;
font-weight: bold;
}
.BP {
vertical-align: text-top;
margin-top: 10px;
margin-left: 245px;
}
.table {
vertical-align: text-top;
font-family: Arial, Helvetica, sans-serif;
font-size: 20px;
text-align: center;
color: #002b55;
margin-left:245px;
}
.TD {
margin-left: 30px;
}
.adress {
font-family: Times New Roman, Times, serif;
font-size: 10px;
text-align: center;
font-weight: bold;
color: #100073;
}
.OOT {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: bold;
color: #100073;
text-align:center;
}
.res {
vertical-align: top;
padding-left: 25px;
}
</style>
</head>
<body>
<div>
<img style="position: relative;" src="http://i1300.photobucket.com/albums/ag93/dobriyan/E-mail%20-%20Ayara%20Kamala/BK_zpsa93ab347.png" alt="Background" />
</div>
<div id="Container">
<div id="Room" >
<a href="http://bit.ly/XSyPG5" title="Deluxe" target="_blank" >
<img src="http://i1300.photobucket.com/albums/ag93/dobriyan/E-mail%20-%20Ayara%20Kamala/D_zpsf4ea5de8.jpg" border="0px" alt="Deluxe" />
</a>
<a href="http://bit.ly/XSyPG5" title="Grand Deluxe" target="_blank" >
<img class="Spacer" src="http://i1300.photobucket.com/albums/ag93/dobriyan/E-mail%20-%20Ayara%20Kamala/GD_zpse78278b7.jpg" border="0px" alt="Grand Deluxe" />
</a>
<a href="http://bit.ly/XSyPG5" title="Grand Pool Villa" target="_blank" >
<img class="Spacer" src="http://i1300.photobucket.com/albums/ag93/dobriyan/E-mail%20-%20Ayara%20Kamala/GPV_zpsb381cd33.jpg" border="0px" alt="Grand Pool Villa" />
</a>
<br />
<span id="D">Deluxe</span>
<span id="GD">Grand Deluxe</span>
<span id="GPV">Grand Pool Villa</span>
</div>
<div id="Content" class="content">Situated on a hill, Ayara Kamala offers a beautiful garden and ocean view rooms. The place of the hotel provides quiet, calm and romantic holiday away from all other hotels on Kamala Beach.
<br />
<br />
Big size of rooms, king size beds and impressive bathrooms, are making Ayara Kamala perfect selection for couples who are looking for privacy and relaxing holiday.
</div>
<table class="table" style="border-collapse: separate; border-spacing: 1px;" width="625" border="0">
<tr>
<td align="right" style="padding-left: 20px;" width="302"><img src="http://i1300.photobucket.com/albums/ag93/dobriyan/E-mail%20-%20Ayara%20Kamala/BP_zps15c948a1.png" border="0px" alt="Best Rate"/></td>
<td width="321" valign="top"><table class="TD" style="border-collapse: separate; border-spacing: 0px;" border="0px">
<tr>
<td height="30" class="res" align="center"><span>www.b2b.onlyonetour.com</span></td>
</tr>
<tr>
<td class="res" height="30" align="center"><span>Tel : (66) 02 - 688 - 8883 </span> </td>
</tr>
<tr>
<td class="res" height="30" align="center"><span>rsvn#onlyonetour.com</span></td>
</tr></table>
</td>
</tr>
</table>
<div align="center" id="Right"><a style="text-decoration: none;" href="http://bit.ly/XSyPG5" title="Only One Tour & Travel Group Co., Ltd." target="_blank"><img width="149px" height="90px" src="http://i1300.photobucket.com/albums/ag93/dobriyan/E-mail%20-%20Ayara%20Kamala/logoOOT_zps24c21653.png" border="0px" alt="Logo" /></a>
<a style="text-decoration: none;" href="http://bit.ly/XSyPG5" title="Only One Tour & Travel Group Co., Ltd." target="_blank"><span class="OOT">Only One Tour & Travel<br />Group Co., Ltd.</span></a><br /><br />
<a style="text-decoration: none;" href="http://on.fb.me/XXqq56" title="Only One Tour Facebook Page" target="_blank"> <img src="http://i1300.photobucket.com/albums/ag93/dobriyan/E-mail%20-%20Ayara%20Kamala/facebook-logo-png-format-i18_zps83b6a9aa.png" width="145px" height="50px" border="0px" alt="FB"/></a><br /><br />
<span class="adress">2128/9-11 Charoenkung Rd.,</span><br />
<span class="adress">Watprayakrai, Bangkorleam,</span><br />
<span class="adress">10120 Bangkok, Thailand.</span><br />
<a class="adress" href="http://bit.ly/XSyPG5" target="_blank">www.b2b.onlyonetour.com</a><br />
<a class="adress" href="http://on.fb.me/XXqq56" target="_blank">www.onlyonetour.com (offline)</a>
</div>
</div>
</body>
</html>
Now add <div align="center"></div> only for newsletter
as like this
<div align="center">
<img style="position: relative;" src="http://i1300.photobucket.com/albums/ag93/dobriyan/E-mail%20-%20Ayara%20Kamala/BK_zpsa93ab347.png" alt="Background" />
</div>
<div id="Container" align="center">
// your code
</div>
<!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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
body{
background: url(http://i1300.photobucket.com/albums/ag93/dobriyan/E-mail%20-%20Ayara%20Kamala/BK_zpsa93ab347.png) no-repeat top#FFF;
}
#wrapper
{
width:950px;
margin:0px auto;
padding:0px;
}
div#Container {
width: 895px;
height: 525px;
position: absolute;
left: 9px;
top: 15px;
}
div#Room {
padding-left: 410px;
padding-top: 80px;
width: 625px;
}
#Room span {
font-family: Times New Roman, Times, serif;
font-weight: bold;
font-size: 23px;
color: #522405;
}
#D { padding-left: 70px;
}
#GD { padding-left: 103px;
}
#GPV { padding-left: 53px;
}
div#Content {
padding-left: 410px;
padding-top: 10px;
width: 625px;
}
#Right {
position: absolute;
left:1030px;
top: 222px;
}
img.Spacer {
margin-left: 10px;
}
div.content {
font-family: Arial, Helvetica, sans-serif;
color: black;
font-size: 17px;
font-weight: bold;
}
.BP {
vertical-align: text-top;
margin-top: 10px;
padding-left: 410px;
}
.table {
vertical-align: text-top;
font-family: Arial, Helvetica, sans-serif;
font-size: 20px;
text-align: center;
color: #002b55;
padding-left: 410px;
}
.TD {
margin-left: 30px;
}
.adress {
font-family: Times New Roman, Times, serif;
font-size: 10px;
text-align: center;
font-weight: bold;
color: #100073;
}
.OOT {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: bold;
color: #100073;
text-align:center;
}
.res {
vertical-align: top;
padding-left: 25px;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="Container">
<div id="Room" >
<a href="http://bit.ly/XSyPG5" title="Deluxe" target="_blank" >
<img src="http://i1300.photobucket.com/albums/ag93/dobriyan/E-mail%20-%20Ayara%20Kamala/D_zpsf4ea5de8.jpg" border="0px" alt="Deluxe" />
</a>
<a href="http://bit.ly/XSyPG5" title="Grand Deluxe" target="_blank" >
<img class="Spacer" src="http://i1300.photobucket.com/albums/ag93/dobriyan/E-mail%20-%20Ayara%20Kamala/GD_zpse78278b7.jpg" border="0px" alt="Grand Deluxe" />
</a>
<a href="http://bit.ly/XSyPG5" title="Grand Pool Villa" target="_blank" >
<img class="Spacer" src="http://i1300.photobucket.com/albums/ag93/dobriyan/E-mail%20-%20Ayara%20Kamala/GPV_zpsb381cd33.jpg" border="0px" alt="Grand Pool Villa" />
</a>
<br />
<span id="D">Deluxe</span>
<span id="GD">Grand Deluxe</span>
<span id="GPV">Grand Pool Villa</span>
</div>
<div id="Content" class="content">Situated on a hill, Ayara Kamala offers a beautiful garden and ocean view rooms. The place of the hotel provides quiet, calm and romantic holiday away from all other hotels on Kamala Beach.
<br />
<br />
Big size of rooms, king size beds and impressive bathrooms, are making Ayara Kamala perfect selection for couples who are looking for privacy and relaxing holiday.
</div>
<table class="table" style="border-collapse: separate; border-spacing: 1px;" width="625" border="0">
<tr>
<td align="right" style="padding-left: 20px;" width="302"><img src="http://i1300.photobucket.com/albums/ag93/dobriyan/E-mail%20-%20Ayara%20Kamala/BP_zps15c948a1.png" border="0px" alt="Best Rate"/></td>
<td width="321" valign="top"><table class="TD" style="border-collapse: separate; border-spacing: 0px;" border="0px">
<tr>
<td height="30" class="res" align="center"><span>www.b2b.onlyonetour.com</span></td>
</tr>
<tr>
<td class="res" height="30" align="center"><span>Tel : (66) 02 - 688 - 8883 </span> </td>
</tr>
<tr>
<td class="res" height="30" align="center"><span>rsvn#onlyonetour.com</span></td>
</tr></table>
</td>
</tr>
</table>
<div align="center" id="Right"><a style="text-decoration: none;" href="http://bit.ly/XSyPG5" title="Only One Tour & Travel Group Co., Ltd." target="_blank"><img width="149px" height="90px" src="http://i1300.photobucket.com/albums/ag93/dobriyan/E-mail%20-%20Ayara%20Kamala/logoOOT_zps24c21653.png" border="0px" alt="Logo" /></a>
<a style="text-decoration: none;" href="http://bit.ly/XSyPG5" title="Only One Tour & Travel Group Co., Ltd." target="_blank"><span class="OOT">Only One Tour & Travel<br />Group Co., Ltd.</span></a><br /><br />
<a style="text-decoration: none;" href="http://on.fb.me/XXqq56" title="Only One Tour Facebook Page" target="_blank"> <img src="http://i1300.photobucket.com/albums/ag93/dobriyan/E-mail%20-%20Ayara%20Kamala/facebook-logo-png-format-i18_zps83b6a9aa.png" width="145px" height="50px" border="0px" alt="FB"/></a><br /><br />
<span class="adress">2128/9-11 Charoenkung Rd.,</span><br />
<span class="adress">Watprayakrai, Bangkorleam,</span><br />
<span class="adress">10120 Bangkok, Thailand.</span><br />
<a class="adress" href="http://bit.ly/XSyPG5" target="_blank">www.b2b.onlyonetour.com</a><br />
<a class="adress" href="http://on.fb.me/XXqq56" target="_blank">www.onlyonetour.com (offline)</a>
</div>
</div>
</div>
</body>
</html>
i changes your code and make it center alignment.for using div first u have set the main id(div which named as warapper) and set the margin as margin:0px auto; which automatically align your page center to all browsers
Give the container the whole width of the page by setting width: 100%;, then set the margins of the div you want centered to auto:
margin-left: auto;
margin-right: auto;
I have a created a table that use simple JS and an API to pull in info about our Android App. We would like to have this code on multiple pages
<div class="api">
<div style="margin: 0 auto; max-width: 700px;">
<div style="float: left;">
<table style="background-color: #e7e7e27; border-color: #e2e2e2;">
<td style="vertical-align: middle; text-align: center; background: #e2e2e2; border-top: 0px; ">
<a rel="nofollow" href="https://play.google.com/store/apps/<!---package name--->" class="no_ul external" target="_blank">
<img src="http://developer.android.com/images/brand/Google_Play_Store_96.png" style="width:90px; border:0" alt="<!---Verbage--->" title="<!---Verbage--->">
</a>
</td>
</table>
</div>
<div style="float: left;">
<div class='appbrain-app'>
<a href='http://www.appbrain.com/app/<!---package name--->' style='font-size: 11px; color: #555; font-family: Arial, sans-serif;'>
</a>
</div>
<script type='text/javascript' language='javascript' src='http://www.appbrain.com/api/api.nocache.js'></script>
</div>
</div>
</div>
Not the prettiest code but it does the job that I we are wanting. I would like to turn this into a plugin with a shortcode to reference it. I know that this is probably bigger then I expect and I have a good understanding of HTML and wordpress but this is the first plugin I have created.
Thanks,
Grady
A plugin to do this is fairly trivial since you are just echoing static data.
class My_App_Data {
function __construct() {
add_shortcode('app_data',array($this,'app_data_shortcode'));
}
function app_data_shortcode() { ?>
<div class="api">
<div style="margin: 0 auto; max-width: 700px;">
<div style="float: left;">
<table style="background-color: #e7e7e27; border-color: #e2e2e2;">
<td style="vertical-align: middle; text-align: center; background: #e2e2e2; border-top: 0px; ">
<a rel="nofollow" href="https://play.google.com/store/apps/<!---package name--->" class="no_ul external" target="_blank">
<img src="http://developer.android.com/images/brand/Google_Play_Store_96.png" style="width:90px; border:0" alt="<!---Verbage--->" title="<!---Verbage--->">
</a>
</td>
</table>
</div>
<div style="float: left;">
<div class='appbrain-app'>
<a href='http://www.appbrain.com/app/<!---package name--->' style='font-size: 11px; color: #555; font-family: Arial, sans-serif;'></a>
</div>
<script type='text/javascript' language='javascript' src='http://www.appbrain.com/api/api.nocache.js'></script>
</div>
</div>
</div><?php
}
}
new My_App_data();
You can now use [app_data /] to display the markup.
You will need to construct a proper plugin header, and use a better name for the class :).
Reference
https://codex.wordpress.org/Writing_a_Plugin