How do I enlarge images on a web page - html

I am using one template to build my web site. I want to add some pictures on a page that are enlarged and opened in a new window when user clicks them.
I have found some pieces of code by search but real problem I am facing is that this template is build using CSS of which I have very less exposure. Those pieces of code required putting code in body of HTML that I am not able to do here using this template.
Here is style sheet I am using & made all pages using it. How do I add few pictures to a page like when they are clicked, are enlarged in a new window.
* {
margin: 0;
padding: 0;
}
a:link {
color: #506F09;
}
body {
background: url(images/backgr.jpg) top left no-repeat #2D2E2B;
}
#tot{
position:relative;
overflow:hidden;
z-index:0;
}
#antet{
background:#2D2E2B;
height:100px;
border-bottom:#F7FDE1 solid 7px;
margin-left: 157px;
}
.butonas1{
background:url(images/butonas3.png) left no-repeat;
height:62px;
width:125px;
position:absolute;
top:-36px;
font-family: Arial, Helvetica, sans-serif;
color:;
font-size:22px;
line-height:62px;
text-align:center;
font-weight:bold;
}
.butonas1 a:link{
text-decoration:none;
color:#2D2E2B;
height:62px;
width:125px;
}
.butonas1 a:visited{
text-decoration:none;
color:#2D2E2B;
height:62px;
width:125px;
}
.butonas1 a:hover{
text-decoration:none;
color:#2D2E2B;
}
.butonas2{
background:url(images/butonas1.png) left no-repeat;
height:62px;
width:125px;
position:absolute;
top:-36px;
font-family: Arial, Helvetica, sans-serif;
color:#F7FDE1;
font-size:22px;
line-height:62px;
text-align:center;
font-weight:bold;
}
.butonas2 a:link{
text-decoration:none;
color:#F7FDE1 ;
}
.butonas2 a:visited{
text-decoration:none;
color:#F7FDE1 ;
}
.butonas2 a:hover{
background:url(images/butonas3.png) left top no-repeat;
text-decoration:none;
height:62px;
width:125px;
position:absolute;
top:0;
left:0;
color:#2D2E2B;
}
#logo_sus{
background:url(images/logo1.png) left no-repeat;
height:178px;
width:171px;
position:absolute;
left:274px;
top:60px;
}
#bara {
position:relative;
height:62px;
}
#container{
width:408px;
background:url(images/sus.jpg) top center no-repeat #F7FDE1;
float:left;
margin-left:470px;
display:inline;
z-index:1;
}
#jos {
background:url(images/jos.jpg) no-repeat bottom center;
width:408px;
height:30px;
z-index:1;
}
.text{
width:380px;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
text-align:justify;
margin:30px 12px;
}
.titlu {
color:#506F09;
font:Verdana, Arial, Helvetica, sans-serif;
font-size:16px;
font-weight:bold;
}
.titlu2 {
color:#506F09;
font:Verdana, Arial, Helvetica, sans-serif;
font-size:22px;
font-weight:bold;
padding-left:170px;
padding-top:20px;
}
.clear{
height:1px;
clear:both;
}
#bottom {
background:url(images/bara.jpg) bottom left no-repeat;
height:30px;
width:556px;
float:left;
margin-left:340px;
margin-top:30px;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
color:#F7FDE1;
text-align:right;
display:inline;
z-index:1;
}
#bottom span{
padding-right:25px;
}
#jos2 {
background:url(images/jos2.jpg) no-repeat bottom center;
width:563px;
height:53px;
z-index:1;
}

How do I add few pictures to a page like when they are clicked, are enlarged in a new window.
You do not need CSS to achieve that. Just add an anchor around the image in your markup:
<a href="/images/image1_large.jpg" title="Open picture in new window" target="_blank">
<img src="/images/image1_small.jpg" alt="Image 1" />
</a>
But if you like a STRICT doctype, or if you trust your readers on using the therefore designed browser features, I would recommend to open the image in the same window; the user can always override that with middle- or right mouseclick:
<a href="/images/image1_large.jpg" title="Open picture in this window">
<img src="/images/image1_small.jpg" alt="Image 1" />
</a>
And to open a link in a popup window, you need to call the JavaScript window.open(); routine, as explained e.g. on this page.

Related

How should I make a button higher without effecting other elements?

I have a navigation bar at the top of my website.
HTML:
<text align="center">
<div class="home-nav">
<button class="nav-btn">What's New</button>
<button class="nav-btn">Community</button>
<button class="play-btn">Coming Soon</button>
<button class="nav-btn">Profile</button>
<button class="nav-btn">Information</button>
</text>
CSS:
.home-nav {
width:1240px;
height:49px;
background-color:#F1B84E;
border:5px solid #FFDE84;
border-style:outset;
}
.nav-btn {
width:auto;
height:49px;
background-color:#F1B84E;
border:none;
font-family:showcard gothic;
color:white;
-webkit-text-stroke:1.25px #000000;
-webkit-text-fill-color:#FFFFFF;
font-size:20px;
}
.play-btn {
width:auto;
height:69px;
background-color:#79E119;
-moz-border-radius:10px;
-webkit-border-radius:10px;
border:5px solid #FFFFFF;
font-size:20px;
font-family:showcard gothic;
color:white;
}
I want the play button to be bigger than the normal buttons. But when I make the height higher than the normal buttons and look at it, it makes the normal buttons change position. How can I fix this?
Ok I have bring some small changes to your CSS styling just try these and let me know its working as you wanted or not.
body{
margin:0; padding:0;
}
.home-nav {
width:90%;
margin: 0 auto;
display: block;
background-color:#F1B84E;
border:5px solid #FFDE84;
border-style:outset;
}
.nav-btn {
width:auto;
height:49px;
background-color:#F1B84E;
border:none;
font-family:showcard gothic;
color:white;
-webkit-text-stroke:1.25px #000000;
-webkit-text-fill-color:#FFFFFF;
font-size:20px;
}
.play-btn {
width:auto;
height:70px;
background-color:#79E119;
-moz-border-radius:10px;
-webkit-border-radius:10px;
border:5px solid #FFFFFF;
font-size:20px;
font-family:showcard gothic;
color:white;
}

styling link text in a div

I am having trouble editing links in a div. I would like the link text to be centered vertically inside it's black div. I would also like the box background to change to red on hover...
thanks so much for any assistance!
html:
<div id="footer_subscribe">
<input type="text" class="subscribe" value="Email Address" />
Subscribe
</div>
<div id="footer_facebook">
<img src="http://s26.postimg.org/q5tytjx2t/nav_facebook.jpg" />
Become a Fan
</div>
<div id="footer_youtube">
<img src="http://s26.postimg.org/rywvhvi9h/nav_youtube.jpg" />
Watch Us
</div>
css:
#footer_subscribe {
background:#000;
width:305px;
height:35px;
float:left;
padding:0;
}
input.subscribe {
border:2px solid black;
margin:2px;
width:200px;
height:24px;
}
#footer_facebook {
background:#000;
width:155px;
height:35px;
float:left;
padding:0;
margin-left:5px;
}
#facebook_logo {
width:32px;
height:32px;
}
a.footer_social {
font-family:Arial, Helvetica, sans-serif;
font-size:1em;
/* 14px/16=0.875em */
font-style:normal;
text-decoration:none;
color:#FFF;
}
a:link.footer_social {
font-family:Arial, Helvetica, sans-serif;
font-size:1em;
/* 14px/16=0.875em */
font-style:normal;
text-decoration:none;
color:#FFF;
}
a:link.visited.footer_social {
color:#FFF;
}
a:link.hover.footer_social {
color:#F00;
}
http://jsfiddle.net/4os21tzf/
#footer_subscribe {
background:#000;
width:305px;
height:35px;
float:left;
padding:0;
line-height: 33px;
}
#footer_subscribe:hover {
background:red;
}
#footer_facebook {
background: none repeat scroll 0% 0% #000;
width: 155px;
float: left;
padding: 0px;
margin-left: 5px;
line-height: 35px;
height: 35px;
}
#footer_facebook:hover {
background:red;
}
a.footer_social:link {
font-family: Arial,Helvetica,sans-serif;
font-size: 1em;
font-style: normal;
text-decoration: none;
color: #FFF;
vertical-align: top;
padding-top: 10px;
}
a.footer_social:hover{
color: red;
}
JSFIDDLE DEMO
To change the colour of the link on hover?
a.footer_social:hover{
color:#F00;
}
To change the colour background on hover (link):
a.footer_social:hover{
color:#000000;
background-color:red;
}
Change the colour of the background (entire div)
#footer_facebook:hover{
background-color:red;
}
#footer_subscribe:hover
{
background:Red;
}
To change color add this to your CSS:
#footer_subscribe:hover
{
background-color:red;
}
#footer_facebook:hover
{
background-color:red;
}
For text alignment:
a:link.footer_social {
font-family:Arial, Helvetica, sans-serif;
font-size:1em;
/* 14px/16=0.875em */
font-style:normal;
text-decoration:none;
color:#FFF;
vertical-align: top;
}
use display:table; in parent div and use display: table-cell; vertical-align: middle; in link
#footer_subscribe {
display:table;
}
a.footer_social:link{
display: table-cell;
vertical-align: middle;
}
#footer_subscribe:hover{
background-color:red;
}
working jsFiddle Link
hope this works for you.

Drop caps change position when images are floated right

I am trying to replicate as closely as possible the look of a book in html that includes drop caps floated left and multiple images that are floated right. Everything works fine with 1 image floated right...but the drop caps change position when more than 1 image is floated right. It looks fine in my editor but not in any browser I've tested. I've tried everything I can think of...
The css:
body {
background:#9CF;
margin:0;
padding:0;
}
h1 {
font-family:Lusitana, serif;
font-size:14px;
letter-spacing:.3em;
}
h2 {
font-family:'Crimson Text', serif;
font-size:12px;
letter-spacing:.3em;
font-weight:400;
}
p {
font-family:'Crimson Text', serif;
font-size:12px;
line-height:16px;
font-weight:400;
margin-top:0;
color:#000;
text-align:justify;
}
.dropcap {
font-family:'Crimson Text', serif;
font-size:310%;
line-height:65%;
margin-top:3px;
margin-right:6px;
color:#333;
display:inline-block;
float:left;
}
#container {
background:#FFF;
height:698px;
width:452px;
padding:30px 30px 40px;
}
#imagediva {
height:229px;
width:127px;
background:rgba(200,255,255,0.5);
margin:0 0 10px 20px;
}
#imagedivb {
height:180px;
width:268px;
background:rgba(200,255,255,0.5);
margin:0 0 10px 20px;
}
.floatright {
clear:right;
float:right;
}
h1.short,h2.short {
line-height:0;
}
The html
<div id="container">
<div class="floatright" id="imagediva"></div>
<div class="floatright" id="imagedivb"></div>
<h1 class="short">First Flight</h1>
<hr size="1" noshade>
<h2 class="short">1929</h2>
<br>
<p><span class="dropcap">W</span>alter’s first flight experience was in a two seater open biplane when he was ten years old. His father hired a pilot take Walter and his cousin Victor Azevedo on a flight around the Oakland, CA. airport, the same airport from which Amelia Earhart would begin her ill fated attempt to circumnavigate the globe six years later in 1937.
</p>
</div>
Check This Fiddle
Give absolute position to the paragraph tag and also give some width to it. This will solve your problem.
body {
background:#9CF;
margin:0;
padding:0;
}
h1 {
font-family:Lusitana, serif;
font-size:14px;
letter-spacing:.3em;
}
h2 {
font-family:'Crimson Text', serif;
font-size:12px;
letter-spacing:.3em;
font-weight:400;
}
p {
font-family:'Crimson Text', serif;
font-size:12px;
line-height:16px;
font-weight:400;
margin-top:0;
color:#000;
text-align:justify;
position: absolute;
width: 300px
}
.dropcap {
font-family:'Crimson Text', serif;
font-size:310%;
line-height:65%;
margin-top:3px;
margin-right:6px;
color:#333;
display:inline-block;
float:left;
}
#container {
background:#FFF;
height:698px;
width:452px;
padding:30px 30px 40px;
}
#imagediva {
height:229px;
width:127px;
background:rgba(200,255,255,0.5);
margin:0 0 10px 20px;
}
#imagedivb {
height:180px;
width:268px;
background:rgba(200,255,255,0.5);
margin:0 0 10px 20px;
}
.floatright {
clear:right;
float:right;
}
h1.short,h2.short {
line-height:0;
}

How to put this a href in the bottom of the div

I have this code :
<div class="ultime_box">
<div class="ultime_box_photo">
Photo
</div>
<div class="ultime_text">
<div class="ultime_box_title">
Title
</div>
<div class="ultime_box_description">
Description
</div>
link
</div>
<div class="clear"><!--- --></div>
</div>
.ultime_box
{
margin:15px 27px 35px 20px;
color:#FFFFFF;
font-size:13px;
height:100px;
background-color:#cdcccc;
}
.ultime_box_photo
{
width:120px;
margin-right:15px;
float:left;
}
.ultime_text
{
float:left;
width:299px;
}
.ultime_box_title
{
color:#000000;
font-weight:bold;
font-size:12px;
text-transform:uppercase;
line-height:12px;
padding-bottom:13px;
}
.ultime_box_description
{
color:#FFFFFF;
font-size:11px;
line-height:13px;
padding-bottom:13px;
}
a.ultime_box_vai:link, a.ultime_box_vai:visited
{
color:#000000;
font-weight:bold;
font-size:12px;
line-height:12px;
text-decoration:none;
}
a.ultime_box_vai:hover
{
text-decoration:underline;
}
And I'd like to put the link in the bottom of the container div (ultime_box), without using height in the previous divs.
How can I do this?
Here's the solution: http://jsfiddle.net/N7GWV/1/
Give .ultime_box position: relative and your link position: absolute; bottom: 0.
.ultime_box
{
margin:15px 27px 35px 20px;
color:#FFFFFF;
font-size:13px;
height:100px;
background-color:#cdcccc;
position: relative;
}
a.ultime_box_vai:link, a.ultime_box_vai:visited
{
color:#000000;
font-weight:bold;
font-size:12px;
line-height:12px;
text-decoration:none;
position: absolute;
bottom: 0;
}
.ultime_text
{
float:left;
width:299px;
position:relative;
}
a.ultime_box_vai:link, a.ultime_box_vai:visited
{
color:#000000;
font-weight:bold;
font-size:12px;
line-height:12px;
text-decoration:none;
position:absolute;
bottom:0px;
}
this should do what you need. Basically, it's all depending on the position attribute of the divs.
This quick guide should clean you out about it.
You could make your bottom link have this css:
a.bottomLink{
float:left;
width:100%;
}
As your container div height is dynamic (based on content), your bottom link will be on the bottom. If I understood, you want to place link on the bottom of ultime_box, so your html should look like:
<div class="ultime_box">
<div class="ultime_box_photo">
Photo
</div>
<div class="ultime_text">
<div class="ultime_box_title">
Title
</div>
<div class="ultime_box_description">
Description
</div>
link
</div>
<div class="clear"><!--- --></div>
bottom
</div>

Styling an Input Field

When I try to alter the CSS for the input field named "title" below, which is classed by "submissionfield", the position changes, but the height, length, and font of the field do not change.
How could I make the height of the input field "title" 22 px, the length 550 px, and the font Times New Roman? The CSS below does not do it.
Thanks in advance,
John
echo '<form action="http://www...com/.../submit2.php" method="post">
<input type="hidden" value="'.$_SESSION['loginid'].'" name="uid">
<div class="submissiontitle"><label for="title">Story Title:</label></div>
<div class="submissionfield"><input name="title" type="title" id="title" maxlength="1000"></div>
<div class="urltitle"><label for="url">Link:</label></div>
<div class="urlfield"><input name="url" type="url" id="url" maxlength="500"></div>
<div class="submissionbutton"><input name="submit" type="submit" value="Submit"></div>
</form>
';
The CSS:
.submissiontitle
{
position:absolute;
width:100px;
left:30px;
top:200px;
text-align: left;
margin-bottom:3px;
padding:0px;
font-family:Arial, Helvetica, sans-serif;
font-size: 12px;
color:#000000;
}
.submissionfield
{
position:absolute;
width:550px;
left:50px;
top:230px;
text-align: left;
margin-bottom:3px;
padding:0px;
font-family: "Times New Roman", Times, serif;
font-size: 22px;
color:#000000;
}
.urltitle
{
position:absolute;
width:250px;
left:30px;
top:300px;
text-align: left;
margin-bottom:3px;
padding:0px;
font-family:Arial, Helvetica, sans-serif;
font-size: 12px;
color:#000000;
}
.urlfield
{
position:absolute;
width:550px;
left:30px;
top:330px;
text-align: left;
margin-bottom:3px;
padding:0px;
font-family:Arial, Helvetica, sans-serif;
font-size: 11px;
color:#000000;
}
.submissionbutton
{
position:absolute;
width:250px;
left:30px;
top:380px;
text-align: left;
margin-bottom:3px;
padding:0px;
font-family:Arial, Helvetica, sans-serif;
font-size: 11px;
color:#000000;
}
.submittitle
{
position:absolute;
width:250px;
left:30px;
top:150px;
text-align: left;
margin-bottom:3px;
padding:0px;
font-family:Arial, Helvetica, sans-serif;
font-size: 12px;
color:#000000;
}
Use this css:
#title {
font-family: 'Times New Roman';
height:22px;
width:550px;
}
You target the div with just .submissionfield. Try .submissionfield input { // stuff } to target the input element within the div with that class.