Positioning image on the page - html

I have an image in ASP.NET, I hope I can explain this very clearly so you can give very clear answers.
My master form has the following setup:
.page
{
width: auto;
background-color: #fff;
margin: 0px auto 0px auto;
border: 1px solid #496077;
height: auto;
}
.header
{
position: relative;
margin: 0px;
padding: 0px;
background: #4b6c9e;
width: 100%;
}
.header h1
{
font-weight: 700;
margin: 0px;
padding: 0px 0px 0px 20px;
color: #f9f9f9;
border: none;
line-height: 2em;
font-size: 2em;
}
.main
{
padding: 0px 12px;
margin: 12px 8px 8px 8px;
}
.leftCol
{
padding: 6px 0px;
margin: 12px 8px 8px 8px;
width: 200px;
min-height: 200px;
}
.footer
{
color: #4e5766;
padding: 8px 0px 0px 0px;
margin: 0px auto;
text-align: center;
line-height: normal;
}
I have a "contact us" page with variable information about each entry for a person on the left hand margin side of the page (name, address, contact info, etc.). I want to position an image that is just a few pixels past the most far right information given for a certain person, and I want the heightxwidth of the picture to vary based on the height of the text (if the user was to enter more lines for information for each contact person, etc.)
How can I get an image with this positioning? So far I've been able to get an image on the far right side of the screen, but this is not good, as I would like to have 2 columns of contact information for more space on the form.
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<h1>Contact Information<b><img align="left" alt="pic" class="bold"
src="profilepic.jpg"
style="width: 150px; height: 150px; float: right;" vspace="0" /></b></h1>
<b><h2>adsf</h2>
adsf</b> <br />
asdf<br />
asdf</br>
asdf <br />
asdf <br />
asdf
</asp:Content>

have you ever considered using a table? You can style the rows width, text alignment, vertical alignment, and all other styles yadda yadda through using classes; or however you choose. But that will set you up with columns and rows for each person....
<table class="table">
<tr class="tableRow">
<td class="tableDataLeft">
Some Persons info Number 1
</td>
<td class="tableDataMiddle">
Person Number 1's second column of info
</td>
<td class="tableDataRight">
Person number 1's image...<img src/>
</td>
</tr>
<tr>
<tdclass="tableDataLeft">
Some Persons info Number 2
</tdclass="tableDataLeft">
<td class="tableDataMiddle">
Person Number 2's second column of info
</td>
<td class="tableDataRight">
Person number 2's image...<img src/>
</td>
</tr>
</table>

Related

Embedded music player not displaying?

I've recently been attempting to insert music into a blog page using the Billy audio player. I've done this before several times, but this time the player isn't showing up on the completed page (I looked on both FireFox and Google Chrome) and I cannot for the life of me figure out why.
Here's a sample of the code I've written:
<html>
<head>
<title>Playlists</title>
<style>
/* --- MAIN FORMATTING --- */
body
{
background: #888888;
margin: 0px;
padding: 75px;
word-wrap: break-word;
}
h1
{
margin: -26px 0px -4px 10px;
font-size: 30px;
line-height: 30px;
font-style: italic;
color: #f9f9f9;
text-shadow: -1px 0 #000000, 0 1px #000000, 1px 0 #000000, 0 -1px #000000;
}
/* --- CONTENT --- */
.content
{
width: 620px;
background-color: #202020;
border: 1px solid rgba(249,249,249,0.1);
border-radius: 10px;
padding: 8px 10px;
margin: 0px;
color: rgba(255,255,255,0.7);
}
/* --- MUSIC PLAYER --- */
.musicplayer
{
color: black;
text-decoration: none;
background-color: #ffffff;
border: 0px solid black;
border-radius: 25px;
padding: 5px 8px;
margin: -26px 0px 2px 420px;
width: 200px;
height: 12px;
}
/* --- TABLE --- */
table
{
border-collapse: collapse;
color: rgba(255,255,255,0.5);
line-height: 130%;
}
tr
{
border-bottom: 1px solid rgba(255,255,255,0.1);
}
td
{
padding: 2px 5px;
}
</style>
</head>
<body>
<h1>Playlist</h1>
<div class="musicplayer"><embed src="http://www.sheepproductions.com/billy/billy.swf?autoplay=false&f0=http://k007.kiwi6.com/hotlink/2w46d4u3sh/Citizen_Soldiers.mp3&t0=Citizen Soldiers&f1=http://k003.kiwi6.com/hotlink/8kun7qcg5t/Immortals.mp3&t1=Immortals&f2=http://k003.kiwi6.com/hotlink/3rzujskuoo/Rewind.mp3&t2=Rewind&f3=http://k003.kiwi6.com/hotlink/oyl9ee9xsw/No_End_No_Beginning.mp3&t3=No End, No Beginning&f4=http://k003.kiwi6.com/hotlink/xgpyq94ryc/Sound_the_Bugle.mp3&t4=Sound the Bugle&total=5" quality="high" wmode="transparent" width="200px" height="10px" name="billy" align="middle" type="application/x-shockwave-flash"/></div>
<div class="content">
<table>
<tr>
<td width=15px>1.</td>
<td width=200px>
"Citizen Soldiers"</a></td>
<td width=400px>3 Doors Down</td>
</tr>
<tr>
<td>2.</td>
<td>
"Immortals"</a></td>
<td>Fall Out Boy</td>
</tr>
<tr>
<td>3.</td>
<td>
"Rewind"</a></td>
<td>Poets of the Fall</td>
</tr>
<tr>
<td>4.</td>
<td>
"No End, No Beginning"</a></td>
<td>Poets of the Fall</td>
</tr>
<tr style="border: 0px;">
<td>5.</td>
<td>
"Sound the Bugle"</a></td>
<td>Bryan Adams</td>
</tr>
</table>
</div>
</body>
</html>
Can anyone tell me what it is I might be forgetting/doing wrong?
EDIT: This is going on a custom Tumblr page, if that makes any difference.
I pulled your code in notepad++ and it is working in for chrome and firefox. If you are trying to insert into a blog or forum they might have their own syntax on html posts.
I managed to figure out the problem. There was nothing wrong with my code: as it turns out, Tumblr's option to serve blogs over SSL was interfering with the embed. I turned the option off, and the music player now appears as intended.

HTML Box - make it look like another website

In this code -
<style>
#boxx{
box-shadow: 0 0 5px 0 rgba(0,0,0,0.3);
border: 6px solid #fff;
background-color: #0e5b93;
min-height: 345px;
max-width: 745 px;
padding-left: 15px;
padding-right: 15px;
}
#ter {
text-align: center;
}
</style>
<div id="boxx">
<table>
<tr>
<td width="500px">
<p style="font-size: 28px; color: #FFF; padding-top: 27px;">Start earning money with your own blog like this one?</p>
<br>
<p style="font-size: 18px; color: #FFF;">This website was created with Thrive Themes and WordPress. Using the suite of tools provided by Thrive Themes is the fastest way for you to create your own website or blog that is <b>fully optimized for maximum conversions</b>. Click the button to get started.</p>
</td>
<td width="251">
<span id="ter" style="width:500px;background:white" onmouseover="this.style.background='gray';" onmouseout="this.style.background='white';">Click Here to Get Thrive Themes</span>
</td>
</tr>
</table>
</div>
I want "Click Here to Get Thrive Themes" box to look like the box on this webpage below-
http://zacjohnson.com/how-will-you-stand-out-from-the-crowd/
What changes I require to make?
I have modified your HTML and CSS a bit to replicate the button in that website you have posted for you.
You can adjust the CSS to suit your exact needs
#boxx {
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3);
border: 6px solid #fff;
background-color: #0e5b93;
min-height: 345px;
max-width: 745 px;
padding-left: 15px;
padding-right: 15px;
}
a {
color: white;
text-decoration: none;
}
button {
cursor: pointer;
text-align: center;
border-radius: 8px;
border: none;
background-color: #124463;
text-align: center;
-webkit-box-shadow: 0px 2px 0px black;
-moz-box-shadow: 0px 2px 0px black;
box-shadow: 0px 2px 0px black;
width: 150px;
height:80px;
font-weight: 500;
margin-top:150px;
margin-left:20px;
float: right;
font-size:14px;
}
button:hover {
opacity: 0.8;
}
<div id="boxx">
<table>
<tr>
<td width="500px">
<p style="font-size: 28px; color: #FFF; padding-top: 27px;">Start earning money with your own blog like this one?</p>
<p style="font-size: 18px; color: #FFF;">This website was created with Thrive Themes and WordPress. Using the suite of tools provided by Thrive Themes is the fastest way for you to create your own website or blog that is <b>fully optimized for maximum conversions</b>. Click the button
to get started.</p>
</td>
<td>
<button id="ter">Click Here to Get Thrive Themes
</button>
</td>
</tr>
</table>
</div>

border-collapse in table not working

I'm needing to collapse a table and it's not working for me. I'm using inline styling in WordPress because it's just one page that will be styled like this.
<table style="border-collapse: collapse; max-width: 100%; height: auto; margin: 0 auto;">
<tbody>
<tr>
<td style="background-color: #299696; margin: 0 auto; ">
<div style="float: right !important; width: 40%; padding-left: 5%;">
<img style="float: right !important; width: 100%; height: auto; min-width: 325px;" alt="weeSpring parent panel, boy holding apple with heart-shaped bite out of it" src="http://blog.weespring.com/wp-content/uploads/2016/01/43b6e465b5d42899675508a8d0bc0b36-300x220.jpg"
/>
</div>
<div style="float: left !important; width 10%; padding: 6% 1% 0 1%;">
<img style="float: left !important; width: 100%; height: auto;" alt="" src="http://www.weespring.com/media/disclosure-arrow.png" />
</div>
<h5 style="color: #ffffff !important; padding-top: 2%;">Disclosure Statement from weeSpring</h5>
<p style="color: #ffffff !important; font-size: 14px; margin: 0 5% 0 6%; text-align: left !important; font-weight: bold; line-height: 1.4em;"><span style="font-size: 28px;">O</span>n weeSpring, members may be invited to participate in sampling campaigns where they receive complimentary products for review. When posting their reviews, members are required to abide by our disclosure terms:</p>
<p></p>
<p style="color: #ffffff !important; font-size: 14px; margin: 0 5% 0 6%; text-align: left !important; font-weight: bold; line-height: 1.4em;">The Federal Trade Commission requires testing program participants to disclose that they have received products for complimentary testing purposes in all review materials. Please note that failure to abide by these rules may result in suspension
from the weeSpring Parent Panel. Please refer to the following rules and guidelines below for more information.</p>
</td>
</tr>
<tr>
<td style="width: 100%; background-color: #000000; vertical-align: middle;">
<span style="color: #299696 !important; font-size: 1.8em; font-weight: bold;">When Writing Reviews</span>
</td>
</tr>
</tbody>
</table>
So it looks like all I had to do to solve this was add this to my table cell style and oddly, it solved it.
border: solid 0;

How to resize based on zoom or screensize

My HTML code:
<div id="divMainFirst">
<div id="divInnerFirst">
<div id="divTitleHeaderUC">
<span id="spanTitleHeaderUC">Urgent Care Wait Time</span>
</div>
<div id="divSubTitleUC">
<div id="smallText" style="padding:0 5px; position: absolute; bottom: 1%; left: 0; right: 0; color: #000000; text-align: center;">If you are experiencing a life-threatening emergency, call 911 or go to your nearest emergency room. Do not go to the urgent care center.<br>Estimated wait times are provided for general information only, may change at any time, and may not reflect your actual wait time once you arrive.</div>
</div>
</div>
<div id="divInnerNext">
<div id="divTitleHeaderFD">
<span id="spanTitleHeaderFD">Find a Doctor</span>
</div>
<div id="divSubTitleFD">
<span style="width: 100%; text-align: center;">
<table cellpadding="5">
<tr>
<td class="alignLeft">By Name [View All]:</td>
</tr>
<tr>
<td style="padding-left: 15px;">
<select>
<option>TEST1</option>
<option>TEST2</option>
</select>
</td>
</tr>
<tr>
<td class="alignLeft">By Specialty [View All]:</td>
</tr>
<tr>
<td style="padding-left: 15px;">
<select>
<option>TEST1</option>
<option>TEST2</option>
</select>
</td>
</tr>
<tr>
<td class="alignLeft">By Location [View All]:</td>
</tr>
<tr>
<td style="padding-left: 15px;">
<select>
<option>TEST1</option>
<option>TEST2</option>
</select>
</td>
</tr>
</table>
</span>
</div>
</div>
</div>
My CSS code:
#divMainFirst {
display: block;
margin: 0 0 0 200px;
overflow: hidden;
}
#divInnerFirst {
display: inline-block;
margin: 0 0 0 100px;
height: 270px;
padding: 0;
width: 265px;
vertical-align: top;
}
#divInnerNext {
display: inline-block;
margin: 0 0 0 50px;
height: 270px;
width: 265px;
vertical-align: top;
}
#divTitleHeaderUC {
width: 265px;
height: 40px;
background-color: #FFFFFF;
text-align: center;
box-shadow: inset 0 0 10px rgba(245, 159, 36, 0.5);
position: relative;
}
#spanTitleHeaderUC {
width: 100%;
height: 40px;
line-height: 40px;
vertical-align: middle;
background-color: #FFFFFF;
font-family: 'blackjarregular';
font-size: 18pt;
color: #F59F24;
font-weight: bold;
}
#divSubTitleUC {
width: 265px;
height: 220px;
background-color: #FFFFFF;
text-align: center;
-webkit-border-radius: 0 0 5px 5px;
-moz-border-radius: 0 0 5px 5px;
border-radius: 0 0 5px 5px;
-webkit-box-shadow: #F59F24 0px 2px 3px;
-moz-box-shadow: #F59F24 0px 2px 3px;
box-shadow: #F59F24 0px 2px 3px;
position: relative;
}
With the above HTML and CSS code, It displays the following zoomed in and by default:
But when I view it in different size screen it changes to this:
As you can see the size of the box hasn't changed and not shrunk to fit all three boxes instead it overflows on to the next section below the first two and cannot be seen.
How can I modify so boxes changes based on the zoom in/screen size?
Have a look into #media queries within your CSS.
With media queries, you can set break points to change the CSS doing things such as hiding certain elements when they're no longer required for the device they're being used on.
Have a look at https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries
That will give you a much more in-depth explanation behind the queries and how to use them effectively.
use percentages for everything. or #media (min-width: 768px) {}

Remove space between 2 tables HTML CSS and image removes background image

New here, I am creating a website and there seems to be a problem with a table I made to hold an image and a table I made to hold content. Content on left image on right. When I float the Image table right the content table moves completely underneath it. When I float it left there is too much space in between the 2. The code in question is table and table 3.
I want it to display the image block next to the link buttons and the context block underneath the buttons but next to the image block.
The second problem is my logo heading which is an image is removing the background image.
HTML Code
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<link href="Articlepage.CSS" rel="stylesheet" type="text/css">
<title>BEADLES BEADING</title>
</head>
<body id="wrap">
<h1><img src="logo.jpg" alt="logo"></h1>
<a class="mouseover" href="Home Page.html"><img src="Buttons/New button Home Unpressed.jpg" alt="home"></a>
<a class="mouseover1" href="Article Page.html"><img src="Buttons/New button About us pressed.jpg" alt="about_us"></a>
<a class="mouseover2" href="Section Page.html"><img src="Buttons/New button Products Unpressed.jpg" alt="products"></a>
<a class="mouseover3" href="Contact us.html"><img src="Buttons/New button Contact us Unpressed.jpg" alt="contact_us"></a>
<a class="mouseover4" href="url"><img src="Buttons/New button Home Unpressed.jpg" alt="home"></a>
<table3>AD SPACE(Image)</table3>
<table>
<tr>
<td>
<b>IMAGE/CONTENT</b>
<b>IMAGE/CONTENT</b>
<b>IMAGE/CONTENT</b><br>
<b>IMAGE/CONTENT</b>
<b>IMAGE/CONTENT</b>
<b>IMAGE/CONTENT</b>
<br><br><br><br><br><br><br><br><br><br><br>
</td>
</tr>
</table>
<table2>
<tr>
<td>
FOOTER
</td>
<tr>
</table2>
</body>
</html>
CSS code
div {
text-align: left;
position: relative;
font-size: 2.5em;
font-weight: bold;
}
div1 {
text-align: left;
position: relative;
font-size: 1.5em;
text-shadow: 2px 2px black;
font-family: Georgia, Times, serif;
text-shadow: -1px -1px black, 1px 1px;
}
h1 {
text-align: left;
font-family: Arial, Helvetica, sans-serif;
text-shadow: 0.1em 0.1em 0.2em black;
font-size: 2em;
font-style: italic;
float: inline;
border: 3px solid black;
width: 800px;
height: 196px;
padding: 0;
}
h2 {
text-align: left;
position: relative;
font-size: 1.5em;
font-family: Verdana, Helvetica, sans-serif;
text-shadow: -1px -1px black, 1px 1px;
}
p {
position: relative;
text-align: left;
font-size: 1em;
font-family: Georgia, Times, serif;
text-shadow: -1px -1px black, 1px 1px;
}
li {
position: relative;
font-size: 1em;
}
a {
padding: 0;
float: left;
}
b {
border: 3px solid black;
width: 180px;
height: 10.5em;
padding: 10px;
float: left;
}
b1 {
border: 3px solid black;
position: absolute;
width: 40px;
height: 23em;
padding: 10px;
float: right;
position: relative;
}
b2 {
border: 3px solid black;
position: absolute;
width: 40px;
height: 23em;
padding: 10px;
position: relative;
}
body {
background-image: url("background.jpg");
background-size: 100%;
margin: 20px;
width: 800px;
padding: 30px;
position: relative;
}
.centeredImage {
text-align: center;
margin-top: 0px;
margin-bottom: 0px;
}
table {
display: inline-block;
width: 640px;
margin-left: auto;
margin-right: auto;
border-style: solid;
border-width: 5px;
text-align: center;
height: 400px;
padding: 0;
}
table2 {
display: inline-block;
width: 625px;
margin-left: auto;
margin-right: auto;
border-style: solid;
border-width: 5px;
text-align: center;
height: 50px;
}
td {
text-shadow: 0.1em 0.1em 0.2em black;
font-family: "Times New Roman", Times, serif;
}
table3 {
float: right;
width: 150px;
border-style: solid;
border-width: 5px;
text-align: right;
height: 490px;
padding: 0;
}
p2 {
border: 10px solid black;
float: rights;
}
select {
width: 200px;
}
#wrap {
width: 900px;
margin: 0 auto;
}
Image link.
Look I am sure you get the just of what it should look like. Plus the white background should have a lilac image I placed into the body as background.
I think the two main problems are:
You are using tags that don't exist and
You aren't considering the width of the borders when setting your sizes
You set the width of the body to 800px, the first table to 640px, and that table3 to 150px. But the borders on both are 5px wide. 640 + 10 (left and right border of the first table) +10 (left and right border of the second table) + 150 = 810. Even if the tags were correct they're too wide to go next to each other.
Change
<table3>Ad Space</table3>
and
<b>IMAGE/CONTENT</b>
<b>IMAGE/CONTENT</b>
<b>IMAGE/CONTENT</b><br>
<b>IMAGE/CONTENT</b>
<b>IMAGE/CONTENT</b>
<b>IMAGE/CONTENT</b>
To
<div id="adCol">Ad Space</div>
and
<div id="#imgDiv">
<img />
<img />
<img /><br />
<img />
<img />
<img />
</div>
In your CSS change "b" to "#imgDiv img", "table" to "#imgDiv", and "table3" to "#adCol". Then either reduce the width of the borders or make one of them at least 10px smaller in width.
Don't forget to also remove the table2 tag and change whatever you've called b1 and b2 to use real HTML tags and change b1 and b2 in your CSS to class names or ids.
Also, consider not setting the width of the body. You probably don't need that.
In this case I see what your trying to accomplish but you should really use divs it would make it easier.
But why don't you just build (1) table with a layout like this below and place / position it in your content. Instead of creating multiple tables. You can still use CSS to add your effects.
<div id="apDiv3">
<table width="100%" height="335" border="1">
<tr>
<td width="87%" height="207">CONTENT</td>
<td width="13%" rowspan="2"><span class="style5">AD SPACE(Image)</span></td>
</tr>
<tr>
<td height="50">Footer</td>
</tr>
</table>
</div>
We don't have tag <table2>. You should use <table>.
If you want to bring two elements near each other, you have to create a div and set the display to flex and bring 2 or more elements into it. You have to set the width of elements to 50% if you want to bring 2 elements. If you want more, you must divide 100 to the number of elements. For example, if you want 5 elements next to each other you must set the width of elements to 20%.