The table looks good on the desktop, but the #media screen of 480x800 makes it go offscreen. Is there a way to line break the contents of table rows in CSS, such that the contents appear on each line instead?
This is how it looks like as of now, i wanted the old man image to proceed to the next line, rather than going offscreen.
This is the html
<div class="sub" id = "history">
<h1>SCIS Roots</h1>
<table class = "table">
<tr>
<td>
<div class = "wrapper">
<img class = "tableImage" src = "../images/bless.jpg" alt = "historyImage1">
<div class = "description">
<p class = "description_content">
The youngest School in Saint Louis University started with the
vision of the then Vice-President for Finance and later University
President, Rev. Fr. Ghisleen de Vos(1976-1983).
</p>
</div>
</div>
</td>
<td>
<div class = "wrapper">
<img class = "tableImage" src = "../images/hist2.png" alt = "historyImage2">
<div class = "description">
<p class = "description_content"> Fr. de Vos saw the
possibility of automating accounting and enrolment systems during
a period where computerization was not yet widely practiced.
</p>
</div>
</div>
</td>
</tr>
</table>
<h3>SCIS- LEVEL UP!</h3>
<table class = "table">
<tr>
<td>
<div class = "wrapper">
<img class = "tableImage" src = "../images/hist7.png" alt = "historyImage3">
<div class = "description">
<p class = "description_content">
SLU catered to the computing needs of other institutions in nearby
regions when it was acquitted by IBM Systems in 1969 and 1980 until
1990.
</p>
</div>
</div>
</td>
<td>
<div class = "wrapper">
<img class = "tableImage" src = "../images/scis.jpg" alt ="historyImage4">
<div class ="description">
<p class = "description_content">
In 1990 it became the Institute of Information and
Computing Science and offered the Computer Science course. The
institute became a college in 1994.
</p>
</div>
</div>
</td>
<td>
<div class = "wrapper">
<img class = "tableImage" src = "../images/hist3.png" alt = "historyImage3">
<div class = "description">
<p>
Courses in Information Technology, Mathematics, Information Management, and Library and
Information Science were added over time. By 1995, it was the first
in the region to offer a graduate program in IT.
</p>
</div>
</div>
</td>
</tr>
</table>
<h3>SCIS REACHES OUT!</h3>
<table class = "table">
<tr>
<td>
<div class = "wrapper">
<img class = "tableImage" src = "../images/ict.jpg" alt = "historyImage4">
<div class = "description">
<p>
In 2007, it hosted the first ever Northern Luzon International IT
conference. This was attended by people from all over the globe and
became an annual event.
</p>
</div>
</div>
</td>
<td>
<div class = "wrapper">
<img class = "tableImage" src = "../images/hist4.jpg" alt = "historyImage4">
<div class = "description">
<p class = "description_content">
To keep up with the trend of Digital Arts technology, the School
has since added short diploma courses in digital animation,
multimedia systems, digital design, editing and publishing, and
the like. The School is also the first in the country to offer the
trending academic initiative - Masters of Science in Service
Management Engineering(MSSME).
</p>
</div>
</div>
</td>
<td>
<div class = "wrapper">
<img class = "tableImage" src = "../images/hist5.png" alt = "historyImage6">
<div class = "description">
<p class = "description_content">
The School is also socially relevant when it comes
to sharing its expertise and resources. In 2007, it donated
multiple computers to the Baguio City National High School(BCNHS)
as part of a collaborative project with the Close the Gap(CTG)
alliance program of Belgium. Along with this, the School designed
and conducted a series of training programs for the teachers of
the BCNHS on several computer and web-based applications.
</p>
</div>
</div>
</td>
</tr>
</table>
<h3>THE FUTURE OF SCIS!</h3>
<p id = "future">
The School's future looks bright as it continues to soar with the
speed of rapid modernization. The School of Computing and
Information and Sciences recognizes though that the power to
create, command, and control information technology comes with
great responsibility. The School therefore primes itself not
only on setting new academic directions towards the advancement
of IT and Computing education and research, but also on
advocating the ethical use of information and computing
technology.
</p>
</div>
This is the css that relates to the table
.wrapper{
float:left;
position:relative;
margin; 0 auto;
}
.description{
position:absolute;
bottom:0px;
left:0px;
width:100%;
background-color:black;
font-family: 'tahoma';
font-size:15px;
color:white;
display:none;
border-radius:3em;
}
a:hover+div{
display: block;
opacity:0.6;
}
.description_content{
padding:10px;
margin:0px;
display:block;
}
.table{
margin-left:auto;
margin-right:auto;
padding: 2px;
}
.tableImage{
width : 304px;
height: 228px;
display: inline;
border:2px solid;
border-radius:2em;
margin:5px;
}
.tableImage:hover{
width : 350px;
height: 300px;
box-shadow:10px 10px 5px #888888;
}
If you want your page to be responsive, I'd move away from placing content in a table. With regards to the images on your page, I'd place each one in a div. The divs would be placed side-by-side by default, with a media query placing them one of top of another for narrow displays.
HTML
<div class="parent">
<div class="img-container">
<img src="..."></img>
</div>
<div class="img-container">
<img src="..."></img>
</div>
</div>
CSS
.img-container {
display: inline-block;
}
#media all and (max-width: 480px) {
.img-container {
display: block;
}
}
Related
I am trying to get the div with div class bioDiv to line up under the image but have tried so many things that I am just getting more and more confused can anyone look at the code for me and give me a clue? Looking to keep the same look just move the div to a more central location.
here is the code:
body {
width: 100%;
height: auto;
background-image: url("../img/marble-background.gif");
background-size: 100% 100vh;
}
img {
border: 10px solid #E3C640;
}
.menuDiv {
background-color: white;
height: 850px;
width: 300px;
margin-top: 70px;
border: 15px solid #E3C640;
padding-top: 50px;
padding-right: 30px;
padding-bottom: 50px;
padding-left: 30px;
}
.bioDiv {
background-color: white;
height: 850px;
width: 1200px;
border: 15px solid #E3C640;
position: relative;
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Welcome to Cary McClures' Portfolio</title>
<style type="text/css">
#import url("bootstrap-5.1.3-dist/css/bootstrap.css");
</style>
</head>
<head>
<body>
<img style="position: absolute; right: 600px; top: 68px
" src="../img/images/me.jpg" width="400" height="600" alt="picture of cary" />
<div class="menuDiv">
<h2 style="color: goldenrod">Home</h2>
<br>
<h2 style="color: goldenrod">Biography</h2>
<br>
<h2 style="color: goldenrod">Education</h2>
<br>
<h2 style="color: goldenrod">Graphic Design</h2>
<br>
<h2 style="color: goldenrod">Freelance</h2>
<br>
<h2 style="color: goldenrod">Baking</h2>
<br>
<h2 style="color: goldenrod">Photo Gallery</h2>
<br>
<h2 style="color: goldenrod">Resume</h2>
<br>
<h2 style="color: goldenrod">Contacts</h2>
<br>
<h2 style="color: goldenrod">Sitemap</h2>
</div>
<div class="bioDiv">
<br>
<h2 style="color: goldenrod">Biography</h2>
<p>Cary L. McClure is an enthusiastic Geneva-based Educator, Culinary Artist, Graphic Designer, and Overachiever with a decade-long background in leadership and customer service.
</p>
<br>
<p>Hailing from Indianapolis originally, Cary’s avid interest in the graphic arts started while he was in high school back in 1983. Unable to attend college, he wound up in the food industry.
</p>
<br>
<p>After working as a Pastry Chef for several years, Cary ultimately has had to alter his career path, due a disability he endured during his time in the military.
</p>
<br>
<p>Currently Cary has been working as a Substitute teacher (K-12) for Adams Central and South Adams Schools.
</p>
<br>
<p>Cary served as an Adjunct Instructor at Ivy Tech Community College, where he taught students about Cakes, Filling and Icings, Wedding Cake Production, and Classical Pastries.
</p>
<br>
<p>In 2019 Cary obtained his bachelor’s degree in Visual Communication (Graphic Design) from Indiana University. Furthermore, he holds an Associates of Applied Science degree (with honors) in Hospitality & Culinary Pastry Arts from Ivy Tech.
</p>
<br>
<p>Outside of his career, Cary L. McClure enjoys reading fantastical books, PS4 and Xbox One gaming, and crafting gum-paste flowers. An avid traveler, he also loves exploring new places and is seeking a position that will allow him to travel across
the country. Above all, he cherishes spending quality time with his family. He is the proud father of one married son.
</p>
<br>
</div>
</body>
</head>
</html>
I would suggest making two containers (an aside and a main) and put the navigation list in the aside and the image and bio in the main. Something like this:
.container {
display: flex;
}
<div class="container">
<aside>
<h1>Put your nav here</h1>
</aside>
<main>
<img src="" height="200" width="300" />
<div>
<h1>Put Bio here</h1>
</div>
</main>
</div>
PS: In case you didn't know, aside and main are semantic HTML5 tags used to markup a page. You can use divs instead of them, but it's not best practice
In Bootstrap you do not have to dictate the widths etc, it can all be done using standard Bootstrap CSS which you dictate as a class= in your HTML. So, for the image you could have that fluid inside a column.
<div class="col-sm-12 col-md-10 mx-auto">
<img src="../img/images/me.jpg" class="img-fluid" alt="picture of cary"/>
</div>
That's full width (12 wide) on small screens and not quite full width (10 wide) on anything larger but mx-auto should center the entire Div. Setting the image to class img-fluid makes it the full width of the Div no matter the screen.
Hopefully after that you can use exactly the same column set up for .bioDiv.
<div class="col-sm-12 col-md-10 mx-auto">
<h2 style="color: goldenrod">Biography</h2>
continued content here....
</div>
Ultimately you are just wrapping the image in a Div and setting both it and bioDiv to the same column parameters. It should not hurt in any way to set up menuDiv a similar way.
I am currently building my first webpage using a custom font from the CSS. This looks like this:
#font-face {
font-family: "Baiti";
src: url("./fonts/baiti.ttf");
}
body { font-family: "Baiti", serif }
.navbar
{
overflow: hidden;
background-color: #333;
position: fixed; /* Set the navbar to fixed position */
top: 0; /* Position the navbar at the top of the page */
width: 100%; /* Full width */
}
/* Links inside the navbar */
.navbar a {
float: right;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 20px;
text-decoration: none;
}
/* Change background on mouse-over */
.navbar a:hover {
background: #ddd;
color: black;
}
/* Main content */
.main {
margin-top: 30px; /* Add a top margin to avoid content overlay */
}
.container{
width:900px;
margin:auto;
}
.box-2 /*targeting class from HTML*/
{
border:8px dotted #ccc;
}
I am now putting some text into my page. Some is inside a table while other is outside of a table:
<html>
<head>
<title>innomotion media</title>
<!--reference CSS file, will only affect CSS PART, HTML comes first-->
<link rel="stylesheet"
type"text/css"
href="styles.css">
</head>
<body>
<!--NavBar-->
<div class="navbar">
Contact
What we do
Who we are
Home
</div>
<!--Heading-->
<div class="container"> <!--width set in css-->
<div align="center" style="padding-top: 50px">
<img
src="./img/banner_top.jpg"
width=100%
</img>
</div>
<div align="center" style="padding-top: 10px" >
<font color="#534f4f" size="+1">
<h1>Hello, friend.</h1>
</font>
</div>
<div align="justify">
<font color="#534f4f" size="+2" >
<p>We here at innomotion media, a young start up located in the heart of Hamburgs' city, will get your own app or (mobile) game going live in no time!
We offer you the cheapest but also the quickest way of getting your app or game finished and monetized.
Sit back and relax while we do all the work for you. Or get involved and create your own assets for us to use and therefore
shorten developement time. Our plans offer 100% flexibility, so that we will tailor the perfect plan for your individual needs.
</p>
</font>
</div>
<div align="center" class="box-2">
<div align="center>
<font color="#534f4f" size="+1">
<h1>Who we are</h1>
</font>
</div>
<div style="padding-left: 15px; padding-right: 15px">
<table border="0">
<tr> <!--tablerow-->
<th width=400px>
<div align="center">
<img
src="./img/me.png"
width=60%
</img>
</div>
</th>
<th width=400px>
<div align="justify">
<font color="#534f4f" size="+2" >
<h3>Julius Tolksdorf</h3>
<p>CEO of innomotion media and head of software developement.<br>
He will be your primary contact during the planning and developement processes.
Julius has already finished about 20 apps & games and has years of experience being an Android developer.
</p>
</font>
</div>
</th>
</rt> <!--for padding-->
<tr height=20px/>
</rt>
</table>
</div>
</div>
</div>
</body>
</html>
But the result looks like this:
So, if my eyes aren't deceiving me, both texts don't look the same, or do they? To me, the one inside the table seems to be "bolder" or "bigger" in a way? or maybe even a bit darker. However, this cannot be from the HTML code I wrote, or am I just blind here?
The problem is that you are using a th tag, which applies the style font-weight:bold (in my browser at least, and presumably yours).
One simple solution is to add a css rule to override this browser default. A better solution is probably to change the ths (table header) to tds (table cell).
I was able to find this problem by copying your html into the stack editor, then right clicking on the bold text, choosing Inspect, then going to computed properties and looking at the applied properties. I suggest you get comfortable with the inspector; it's invaluable in debugging webpage problems.
th {
font-weight:normal;
}
<div class="container"> <!--width set in css-->
<div align="center" style="padding-top: 50px">
<img
src="./img/banner_top.jpg"
width=100%
</img>
</div>
<div align="center" style="padding-top: 10px" >
<font color="#534f4f" size="+1">
<h1>Hello, friend.</h1>
</font>
</div>
<div align="justify">
<font color="#534f4f" size="+2" >
<p>We here at innomotion media, a young start up located in the heart of Hamburgs' city, will get your own app or (mobile) game going live in no time!
We offer you the cheapest but also the quickest way of getting your app or game finished and monetized.
Sit back and relax while we do all the work for you. Or get involved and create your own assets for us to use and therefore
shorten developement time. Our plans offer 100% flexibility, so that we will tailor the perfect plan for your individual needs.
</p>
</font>
</div>
<div align="center" class="box-2">
<div align="center>
<font color="#534f4f" size="+1">
<h1>Who we are</h1>
</font>
</div>
<div style="padding-left: 15px; padding-right: 15px">
<table border="0">
<tr> <!--tablerow-->
<th width=400px>
<div align="center">
<img
src="./img/me.png"
width=60%
</img>
</div>
</th>
<th width=400px>
<div align="justify">
<font color="#534f4f" size="+2" >
<h3>Julius Tolksdorf</h3>
<p>CEO of innomotion media and head of software developement.<br>
He will be your primary contact during the planning and developement processes.
Julius has already finished about 20 apps & games and has years of experience being an Android developer.
</p>
</font>
</div>
</th>
</rt> <!--for padding-->
<tr height=20px/>
</rt>
</table>
</div>
</div>
If you use the dev tools in Chrome to inspect the element, you will see that the font-weight is being inherited from the th cell. You should not be using table headers this way.
I would strongly recommend against using table-based layouts in modern web development, but in this instance, you should be putting your header on one row and move your image and paragraph to a new row, using proper td table cells.
[Edit]
To elaborate further, tables are the old way to achieve a small part of what the modern grid properties achieve. To achieve the desired layout, you will need to use two rows, the first of which should span both columns:
.center{
text-align:center;
}
<table border="0">
<tr>
<th colspan=2>
<h1>Julius Tolksdorf</h1>
</th>
</tr>
<tr>
<td class="center">
<img
src="https://images.pexels.com/photos/730896/pexels-photo-730896.jpeg?auto=compress&cs=tinysrgb&h=750&w=1260"
width=60%
/>
</td>
<td class="center">
<font color="#534f4f" size="+2" >
<p>CEO of innomotion media and head of software developement.
<br>
He will be your primary contact during the planning and developement processes.
Julius has already finished about 20 apps & games and has years of experience being an Android developer.
</p>
</font>
</td>
</tr>
</table>
You are applying size = "+2" to all the text and not just the title
Change this:
<font color="#534f4f" size="+2" >
<h3>Julius Tolksdorf</h3>
<p>CEO of innomotion media and head of software developement.<br> He will be your primary contact during the planning and developement processes. Julius has already finished about 20 apps & games and has years of experience being an Android developer.</p>
</font>
To this:
<font color="#534f4f" size="+2" >
<h3>Julius Tolksdorf</h3>
</font>
<p>CEO of innomotion media and head of software developement.<br> He will be your primary contact during the planning and developement processes. Julius has already finished about 20 apps & games and has years of experience being an Android developer.</p>
Also, check class="box-2" which is assigned only to the first text
I am trying to recreate this team/leadership page:
I have put a box shadow around my ul element, as the example above does. I can't get the margins around the li elements the same way - I set the right margins to be 5 px, but it still bordered with white. How do I get the margins (or space between li elements) to just be filled with the background color of the div (or the ul in this case)?
JSFiddle here: http://jsfiddle.net/mzechar/gyo6t25e/10/
HTML:
<section class = "content-wrapper team">
<h3>Columbia</h3>
<div class = "team-listing">
<ul>
<li>
<div class = "team-member-listing-wrapper">
<div class = "circle-image-crop">
<img class = "team-member-photo" src="BW.jpg" onmouseover="this.src='COLOR.jpg'" onmouseout="this.src='BW.jpg'"">
</div>
Jane Jam
<br>
<span class = "bio">lead the design and development of early tablet PC, UMPC, and mobile phone prototypes and helped with the initial design of the current iPhone app.</span>
</div>
</li>
<li>
<div class = "team-member-listing-wrapper">
<div class = "circle-image-crop">
<img class = "team-member-photo" src="BW.jpg" onmouseover="this.src='COLOR.jpg'" onmouseout="this.src='BW.jpg'"">
</div>
Jane Jam
<br>
<span class = "bio">lead the design and development of early tablet PC, UMPC, and mobile phone prototypes and helped with the initial design of the current iPhone app.</span>
</div>
</li>
<li>
<div class = "team-member-listing-wrapper">
<div class = "circle-image-crop">
<img class = "team-member-photo" src="BW.jpg" onmouseover="this.src='COLOR.jpg'" onmouseout="this.src='BW.jpg'"">
</div>
Jane Jam
<br>
<span class = "bio">lead the design and development of early tablet PC, UMPC, and mobile phone prototypes and helped with the initial design of the current iPhone app.</span>
</div>
</li>
<li>
<div class = "team-member-listing-wrapper">
<div class = "circle-image-crop">
<img class = "team-member-photo" src="BW.jpg" onmouseover="this.src='COLOR.jpg'" onmouseout="this.src='BW.jpg'"">
</div>
Jane Jam
<br>
<span class = "bio">lead the design and development of early tablet PC, UMPC, and mobile phone prototypes and helped with the initial design of the current iPhone app.</span>
</div>
</li>
<li>
<div class = "team-member-listing-wrapper">
<div class = "circle-image-crop">
<img class = "team-member-photo" src="BW.jpg" onmouseover="this.src='COLOR.jpg'" onmouseout="this.src='BW.jpg'"">
</div>
Jane Jam
<br>
<span class = "bio">lead the design and development of early tablet PC, UMPC, and mobile phone prototypes and helped with the initial design of the current iPhone app.</span>
</div>
</li>
<li>
<div class = "team-member-listing-wrapper">
<div class = "circle-image-crop">
<img class = "team-member-photo" src="BW.jpg" onmouseover="this.src='COLOR.jpg'" onmouseout="this.src='BW.jpg'"">
</div>
Jane Jam
<br>
<span class = "bio">lead the design and development of early tablet PC, UMPC, and mobile phone prototypes and helped with the initial design of the current iPhone app.</span>
</div>
</li>
<li>
<div class = "team-member-listing-wrapper">
<div class = "circle-image-crop">
<img class = "team-member-photo" src="BW.jpg" onmouseover="this.src='COLOR.jpg'" onmouseout="this.src='BW.jpg'"">
</div>
Jane Jam
<br>
<span class = "bio">lead the design and development of early tablet PC, UMPC, and mobile phone prototypes and helped with the initial design of the current iPhone app.</span>
</div>
</li>
<li>
<div class = "team-member-listing-wrapper">
<div class = "circle-image-crop">
<img class = "team-member-photo" src="BW.jpg" onmouseover="this.src='COLOR.jpg'" onmouseout="this.src='BW.jpg'"">
</div>
Jane Jam
<br>
<span class = "bio">lead the design and development of early tablet PC, UMPC, and mobile phone prototypes and helped with the initial design of the current iPhone app.</span>
</div>
</li>
<li>
<div class = "team-member-listing-wrapper">
<div class = "circle-image-crop">
<img class = "team-member-photo" src="BW.jpg" onmouseover="this.src='COLOR.jpg'" onmouseout="this.src='BW.jpg'"">
</div>
Jane Jam
<br>
<span class = "bio">lead the design and development of early tablet PC, UMPC, and mobile phone prototypes and helped with the initial design of the current iPhone app.</span>
</div>
</li>
<li>
<div class = "team-member-listing-wrapper">
<div class = "circle-image-crop">
<img class = "team-member-photo" src="BW.jpg" onmouseover="this.src='COLOR.jpg'" onmouseout="this.src='BW.jpg'"">
</div>
Jane Jam
<br>
<span class = "bio">lead the design and development of early tablet PC, UMPC, and mobile phone prototypes and helped with the initial design of the current iPhone app.</span>
</div>
</li>
<li>
<div class = "team-member-listing-wrapper">
<img class = "team-member-photo" src="BW.jpg" onmouseover="this.src='COLOR.jpg'" onmouseout="this.src='BW.jpg'"">
<span class = "team-member-name">Jane Jam</span>
</div>
</li>
</ul>
</div>
</section>
CSS:
section.team{
margin: auto;
overflow: hidden;
background: #FEFEFE;
display:inline-block;
}
.team-listing{
position:relative;
margin-top:40px;
margin-right:auto;
margin-left:auto;
}
.team-listing li{
display:inline-block;
width: 30%;
overflow: hidden;
float:left;
height: 320px;
list-style-position:inside;
margin-right:5px;
background-color:#FEFEFE;
}
.bio{
display: inline-block;
text-align:left;
color: #111;
font-size: 1rem;
line-height: 1;
visibility:hidden;
}
.team-member-listing-wrapper{
text-align: center;
vertical-align: top;
width:100%;
height:100%;
margin: 0 auto;
display:inline-block;
}
.team-member-listing-wrapper strong{
font-size: 1.125rem;
line-height: 1;
}
.team-listing ul{
display:table;
list-style: none;
box-shadow:0 0.9375rem 3.75rem rgba(2,2,22,0.1);
white-space: nowrap;
width:80%;
margin:auto;
}
.circle-image-crop{
width: 180px;
height: 180px;
position: relative;
overflow: hidden;
border-radius: 50%;
margin-left:auto;
margin-right:auto;
margin-top:20px;
}
.circle-image-crop:hover{
height:100%;
width:auto;
border-radius:0%;
}
.circle-image-crop img{
display: inline;
margin: 0 auto;
height: 100%;
width: auto;
}
You would have to use filter: drop-shadow(5px 5px 5px #222); in this case as the shadow for the <ul>.
Box-shadow is only around the div, and doesn't fill the inside of it.
Box-shadow vs Drop shadow
I am trying to reduce the width of a piece of text under an image that only takes up about 50% of the screen, so I've tried using style = width:50% but for some reason, the width stays the same. Here is the output I get. I want it so that the caption is neatly contained under the image. What am I doing wrong?
My code:
<div class="text-center">
<h1>Evelyn Lauder </h1>
<h5 class="font-italic"> 1936-2011</h5>
<img src=h ttp://i.telegraph.co.uk/multimedia/archive/02093/lauder_2093473b.jpg alt="Evelyn Lauder" </img> <br>
</div>
<div style= width: 50%; class="text-center font-italic">
<h7> "Evelyn Lauder was an Austrian American businessman who was well known for popularzing the pink ribbon associated with breast cancer awareness." </h7>
</div>
Your error would be revealed if you had used a validator.
<div style = width: 50%; class = "text-center font-italic">
Quotes around attribute values are required if the attribute value contains space characters.
<div style="width: 50%;" class="text-center font-italic">
NB: You have a number of other errors that the validator will point you towards.
Follow this piece of code.
<div class = "text-center">
<h1 >Evelyn Lauder </h1>
<h5 class = "font-italic" > 1936-2011</h5>
<img src = "http://i.telegraph.co.uk/multimedia/archive/02093/lauder_2093473b.jpg" alt = "Evelyn Lauder"> <br>
<div style="width: 50%;margin: 0 auto;"><h7 > "Evelyn Lauder was an Austrian American businessman who was well known for popularzing the pink ribbon associated with breast cancer awareness." </h7> </div>
</div>
Add style to div. Hope it helps.!
I think you are looking for this.
Apply display:inline-block to your caption text. That's it :)
<div class="text-center">
<h1>Evelyn Lauder </h1>
<h5 class="font-italic"> 1936-2011</h5>
<img src=http://i.telegraph.co.uk/multimedia/archive/02093/lauder_2093473b.jpg alt="Evelyn Lauder" </img> <br>
</div>
<h7 style="width:50%; display:inline-block; font-style:italic;" class="text-center"> "Evelyn Lauder was an Austrian American businessman who was well known for popularzing the pink ribbon associated with breast cancer awareness." </h7>
I'm just wondering if it's possible to move this (image1) to (image2). I don't want to use position:relative as that would ruin my design in bootstrap.
Image 1 (I don't want it here)
http://puu.sh/ciBCF/3d1d6b202a.png
Image 2 ( I want it here)
http://puu.sh/ciBET/0f44f62b3f.png
My code for CSS
.results {
color: red;
display: block;
font-size: 20px;
text-align:center;
text-decoration: none;
font-weight: bold;
background: #232323;
color:red;
font-family: 'Julius Sans One', sans-serif;
font-size: 150%;
}
Thanks in advance :)
UPDATE WHOLE CODE:
<?php
session_start();
include ('../includes/config.php');
include ('../includes/header.php');
?>
<!DOCTYPE HTML>
<html>
<body>
<!--start header-->
<div class="h_bg">
<div class="wrap">
<div class="wrapper">
<div class="header">
<div class="logo">
<img src="../images/logo.png">
</div>
<div class="cssmenu">
<ul>
<li><span>Home</span></li>
<li class="active"><span>About</span></li>
<li class="has-sub"><span>Gallery</span>
</li>
<li class="last"><span>Contact</span></li>
<div class="clear"></div>
<div class="search">
<h2>search</h2>
<form>
<input type="text" value="" placeholder="Enter Your search...">
<input type="submit" value="">
</form>
</div>
<div class="search1">
<h2>login/Register</h2>
<form action="" method="POST">
<label>Username:</label>
<input type="text" id="password" name="username" required />
<label>Password:</label>
<input type="password" id="password" name="password" required />
<input type="submit" value="Login" name="submit" class="submit" />
<br><br>
<center>
<h2><p>Register</p></h2>
</center>
</form>
</div>
<?php
if(isset($_POST["submit"])){
if(!empty($_POST['username']) && !empty($_POST['password'])) {
$username=$_POST['username'];
$password=$_POST['password'];
$password = strip_tags($password);
$password = md5($password); // md5 is used to encrypt your password to make it more secure.
$query=mysql_query("SELECT * FROM login WHERE username='".$username."' AND password='".$password."'");
$numrows=mysql_num_rows($query);
if($numrows!=0)
{
while($row=mysql_fetch_assoc($query))
{
$dbusername=$row['username'];
$dbpassword=$row['password'];
}
if($username == $dbusername && $password == $dbpassword)
{
session_start();
$_SESSION['sess_user']=$username;
/* Redirect browser */
header("Location: member.php");
}
} else {
echo "<div class='results'>Invalid username or password</div>";
}
} else {
echo "All fields are required!";
}
}
?>
</div>
</ul>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<!-- start content -->
<div class="content_bg">
<div class="wrap">
<div class="wrapper">
<div class="main">
<h2 class="style">About us</h2>
<div class="about">
<div class="cont-grid-img img_style">
<img src="../images/about_pic.jpg" alt=""></a>
</div>
<div class="cont-grid">
<div class="abt-style">
<p class="style top">We are a company built on dreams. And these dreams inspire us to create innovative products that enhance human mobility and benefit society. We see "The Power of Dreams" as a way of thinking that guides us and inspires us to move forward. The strength of our company comes from this philosophy—based on the visionary principles of our founder, Soichiro Honda.Our success in the global marketplace is the result of our continued investment in America's future. We thank our customers for the support and trust they've shown us. We look forward to challenging ourselves to create new products and services that bring value to our customers and society during the next 50 years.</p>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
<div class="about-p top">
<p class="style">Honda's global lineup consists of the Fit, Civic, Accord, Insight, CR-V, CR-Z, Legend and two versions of the Odyssey, one for North America, and a smaller vehicle sold internationally. An early proponent of developing vehicles to cater to different needs and markets worldwide, Honda's lineup varies by country and may have vehicles exclusive to that region. A few examples are the latest Honda Odyssey minivan and the Ridgeline, Honda's first light-duty uni-body pickup truck. Both were designed and engineered primarily in North America and are produced there. Other example of exclusive models includes the Honda Civic five-door hatchback sold in Europe.
Honda's automotive manufacturing ambitions can be traced back to 1963, with the Honda T360, a kei car truck built for the Japanese market.[27] This was followed by the two-door roadster, the Honda S500 also introduced in 1963. In 1965, Honda built a two-door commercial delivery van, called the Honda L700. Honda's first four-door sedan was not the Accord, but the air-cooled, four-cylinder, gasoline-powered Honda 1300 in 1969. The Civic was a hatchback that gained wide popularity internationally, but it wasn't the first two-door hatchback built. That was the Honda N360, another Kei car that was adapted for international sale as the N600. The Civic, which appeared in 1972 and replaced the N600 also had a smaller sibling that replaced the air-cooled N360, called the Honda Life that was water-cooled.
The Honda Life represented Honda's efforts in competing in the kei car segment, offering sedan, delivery van and small pick-up platforms on a shared chassis. The Life StepVan had a novel approach that, while not initially a commercial success, appears to be an influence in vehicles with the front passengers sitting behind the engine, a large cargo area with a flat roof and a liftgate installed in back, and utilizing a transversely installed engine with a front-wheel-drive powertrain.</p>
</div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<div class="footer_bg">
<div class="wrap">
<div class="wrapper">
<div class="footer">
<div class="copy">
<p class="w3-link">© </p>
</div>
<div class="f_nav">
<ul>
<li>Skype</li>
<li>Linked in</li>
<li>Twitter</li>
<li>Facebook</li>
</ul>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
</body>
If css 3 is ok for you, then "translate", transformation may help?
e.g:
.results {
...
transform: translate(0px,-200px);
}
you may have to set appropriate value instead of -200px.
Update:
After looking at your code.
Why not place the "php" section where you need to show the error message?
Update 2
Putting up the code example, based on OP's original code as #Moob suggested.
<?php
session_start();
include ('../includes/config.php');
include ('../includes/header.php');
?>
<!DOCTYPE HTML>
<html>
<body>
<!--start header-->
<div class="h_bg">
<div class="wrap">
<div class="wrapper">
<div class="header">
<div class="logo">
<img src="../images/logo.png">
</div>
<div class="cssmenu">
<ul>
<li><span>Home</span></li>
<li class="active"><span>About</span></li>
<li class="has-sub"><span>Gallery</span>
</li>
<li class="last"><span>Contact</span></li>
<div class="clear"></div>
<div class="search">
<h2>search</h2>
<form>
<input type="text" value="" placeholder="Enter Your search...">
<input type="submit" value="">
</form>
</div>
<div class="search1">
<?php
if(isset($_POST["submit"])){
if(!empty($_POST['username']) && !empty($_POST['password'])) {
$username=$_POST['username'];
$password=$_POST['password'];
$password = strip_tags($password);
$password = md5($password); // md5 is used to encrypt your password to make it more secure.
$query=mysql_query("SELECT * FROM login WHERE username='".$username."' AND password='".$password."'");
$numrows=mysql_num_rows($query);
if($numrows!=0)
{
while($row=mysql_fetch_assoc($query))
{
$dbusername=$row['username'];
$dbpassword=$row['password'];
}
if($username == $dbusername && $password == $dbpassword)
{
session_start();
$_SESSION['sess_user']=$username;
/* Redirect browser */
header("Location: member.php");
}
} else {
echo "<div class='results'>Invalid username or password</div>";
}
} else {
echo "All fields are required!";
}
}
?>
<h2>login/Register</h2>
<form action="" method="POST">
<label>Username:</label>
<input type="text" id="password" name="username" required />
<label>Password:</label>
<input type="password" id="password" name="password" required />
<input type="submit" value="Login" name="submit" class="submit" />
<br><br>
<center>
<h2><p>Register</p></h2>
</center>
</form>
</div>
</div>
</ul>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<!-- start content -->
<div class="content_bg">
<div class="wrap">
<div class="wrapper">
<div class="main">
<h2 class="style">About us</h2>
<div class="about">
<div class="cont-grid-img img_style">
<img src="../images/about_pic.jpg" alt=""></a>
</div>
<div class="cont-grid">
<div class="abt-style">
<p class="style top">We are a company built on dreams. And these dreams inspire us to create innovative products that enhance human mobility and benefit society. We see "The Power of Dreams" as a way of thinking that guides us and inspires us to move forward. The strength of our company comes from this philosophy—based on the visionary principles of our founder, Soichiro Honda.Our success in the global marketplace is the result of our continued investment in America's future. We thank our customers for the support and trust they've shown us. We look forward to challenging ourselves to create new products and services that bring value to our customers and society during the next 50 years.</p>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
<div class="about-p top">
<p class="style">Honda's global lineup consists of the Fit, Civic, Accord, Insight, CR-V, CR-Z, Legend and two versions of the Odyssey, one for North America, and a smaller vehicle sold internationally. An early proponent of developing vehicles to cater to different needs and markets worldwide, Honda's lineup varies by country and may have vehicles exclusive to that region. A few examples are the latest Honda Odyssey minivan and the Ridgeline, Honda's first light-duty uni-body pickup truck. Both were designed and engineered primarily in North America and are produced there. Other example of exclusive models includes the Honda Civic five-door hatchback sold in Europe.
Honda's automotive manufacturing ambitions can be traced back to 1963, with the Honda T360, a kei car truck built for the Japanese market.[27] This was followed by the two-door roadster, the Honda S500 also introduced in 1963. In 1965, Honda built a two-door commercial delivery van, called the Honda L700. Honda's first four-door sedan was not the Accord, but the air-cooled, four-cylinder, gasoline-powered Honda 1300 in 1969. The Civic was a hatchback that gained wide popularity internationally, but it wasn't the first two-door hatchback built. That was the Honda N360, another Kei car that was adapted for international sale as the N600. The Civic, which appeared in 1972 and replaced the N600 also had a smaller sibling that replaced the air-cooled N360, called the Honda Life that was water-cooled.
The Honda Life represented Honda's efforts in competing in the kei car segment, offering sedan, delivery van and small pick-up platforms on a shared chassis. The Life StepVan had a novel approach that, while not initially a commercial success, appears to be an influence in vehicles with the front passengers sitting behind the engine, a large cargo area with a flat roof and a liftgate installed in back, and utilizing a transversely installed engine with a front-wheel-drive powertrain.</p>
</div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<div class="footer_bg">
<div class="wrap">
<div class="wrapper">
<div class="footer">
<div class="copy">
<p class="w3-link">© </p>
</div>
<div class="f_nav">
<ul>
<li>Skype</li>
<li>Linked in</li>
<li>Twitter</li>
<li>Facebook</li>
</ul>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
</body>
You may consider using css :after
http://www.w3schools.com/cssref/sel_after.asp
.search1::after {
color: red;
display: block;
font-size: 20px;
text-align:center;
text-decoration: none;
font-weight: bold;
background: #232323;
color:red;
font-family: 'Julius Sans One', sans-serif;
font-size: 150%;
content: "your content here";
}
use script to hide or show it based upon php response.
Edit: whole code illustration
add this CSS:
.search1::after
{
display:block;
content:attr(data-content);
}
<?php
session_start();
include ('../includes/config.php');
include ('../includes/header.php');
?>
<!DOCTYPE HTML>
<html>
<body>
<!--start header-->
<div class="h_bg">
<div class="wrap">
<div class="wrapper">
<div class="header">
<div class="logo">
<img src="../images/logo.png">
</div>
<div class="cssmenu">
<ul>
<li><span>Home</span></li>
<li class="active"><span>About</span></li>
<li class="has-sub"><span>Gallery</span>
</li>
<li class="last"><span>Contact</span></li>
<div class="clear"></div>
<div class="search">
<h2>search</h2>
<form>
<input type="text" value="" placeholder="Enter Your search...">
<input type="submit" value="">
</form>
</div>
<div class="search1">
<h2>login/Register</h2>
<form action="" method="POST">
<label>Username:</label>
<input type="text" id="password" name="username" required />
<label>Password:</label>
<input type="password" id="password" name="password" required />
<input type="submit" value="Login" name="submit" class="submit" />
<br><br>
<center>
<h2><p>Register</p></h2>
</center>
</form>
</div>
<?php
if(isset($_POST["submit"])){
if(!empty($_POST['username']) && !empty($_POST['password'])) {
$username=$_POST['username'];
$password=$_POST['password'];
$password = strip_tags($password);
$password = md5($password); // md5 is used to encrypt your password to make it more secure.
$query=mysql_query("SELECT * FROM login WHERE username='".$username."' AND password='".$password."'");
$numrows=mysql_num_rows($query);
if($numrows!=0)
{
while($row=mysql_fetch_assoc($query))
{
$dbusername=$row['username'];
$dbpassword=$row['password'];
}
if($username == $dbusername && $password == $dbpassword)
{
session_start();
$_SESSION['sess_user']=$username;
/* Redirect browser */
header("Location: member.php");
}
} else {
echo "$('.search1').attr('data-content','Your text Here');";
}
} else {
echo "All fields are required!";
}
}
?>
</div>
</ul>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<!-- start content -->
<div class="content_bg">
<div class="wrap">
<div class="wrapper">
<div class="main">
<h2 class="style">About us</h2>
<div class="about">
<div class="cont-grid-img img_style">
<img src="../images/about_pic.jpg" alt=""></a>
</div>
<div class="cont-grid">
<div class="abt-style">
<p class="style top">We are a company built on dreams. And these dreams inspire us to create innovative products that enhance human mobility and benefit society. We see "The Power of Dreams" as a way of thinking that guides us and inspires us to move forward. The strength of our company comes from this philosophy—based on the visionary principles of our founder, Soichiro Honda.Our success in the global marketplace is the result of our continued investment in America's future. We thank our customers for the support and trust they've shown us. We look forward to challenging ourselves to create new products and services that bring value to our customers and society during the next 50 years.</p>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
<div class="about-p top">
<p class="style">Honda's global lineup consists of the Fit, Civic, Accord, Insight, CR-V, CR-Z, Legend and two versions of the Odyssey, one for North America, and a smaller vehicle sold internationally. An early proponent of developing vehicles to cater to different needs and markets worldwide, Honda's lineup varies by country and may have vehicles exclusive to that region. A few examples are the latest Honda Odyssey minivan and the Ridgeline, Honda's first light-duty uni-body pickup truck. Both were designed and engineered primarily in North America and are produced there. Other example of exclusive models includes the Honda Civic five-door hatchback sold in Europe.
Honda's automotive manufacturing ambitions can be traced back to 1963, with the Honda T360, a kei car truck built for the Japanese market.[27] This was followed by the two-door roadster, the Honda S500 also introduced in 1963. In 1965, Honda built a two-door commercial delivery van, called the Honda L700. Honda's first four-door sedan was not the Accord, but the air-cooled, four-cylinder, gasoline-powered Honda 1300 in 1969. The Civic was a hatchback that gained wide popularity internationally, but it wasn't the first two-door hatchback built. That was the Honda N360, another Kei car that was adapted for international sale as the N600. The Civic, which appeared in 1972 and replaced the N600 also had a smaller sibling that replaced the air-cooled N360, called the Honda Life that was water-cooled.
The Honda Life represented Honda's efforts in competing in the kei car segment, offering sedan, delivery van and small pick-up platforms on a shared chassis. The Life StepVan had a novel approach that, while not initially a commercial success, appears to be an influence in vehicles with the front passengers sitting behind the engine, a large cargo area with a flat roof and a liftgate installed in back, and utilizing a transversely installed engine with a front-wheel-drive powertrain.</p>
</div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<div class="footer_bg">
<div class="wrap">
<div class="wrapper">
<div class="footer">
<div class="copy">
<p class="w3-link">© </p>
</div>
<div class="f_nav">
<ul>
<li>Skype</li>
<li>Linked in</li>
<li>Twitter</li>
<li>Facebook</li>
</ul>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
</body>
You could put the div in the form in the place you want it, set an id and in css set it to display none, then in the else block of your code where you now echo the div drop out of php and use js to show the div if theres an error. i.e
else{ ?>
<script>document.getElementById("your_chosen_id").style.display="block";</script>
<noscript><div class='results' style='position:relative;top:-200px;>Invalid username or password</div></noscript>
<?php
EDIT
Added noscript as Moob correctly pointed out that it obviously wouldn't work with js turned off.