failing to make portfolio responsive - html

i coded my portfoliowebsite myself and my code probably is a mess because i don't have that much experience with code.
The problem i'm having is to make the website responsive so it's also looking good on the phone.
I think the problem is that i used px instead of %, but i tried various stuff and it doesn't look like i want. The website is https://www.jessewensing.com
I'll post a part of the code.
.content {
width: calc(100vw - 30%);
position: relative;
left: 30%;
margin-top: -6%;
}
.menu-header {
font-family: 'Akkurat';
text-align: left;
}
.project-nav {
margin-top: 20px;
font-family: 'Akkurat';
}
img {
cursor:s-resize;
-webkit-filter: drop-shadow(5px 5px 5px #A9A9A9);
filter: drop-shadow(5px 5px 5px #A9A9A9);
top:-2%;
margin-top: 10%;
width:50%;
}
ul {
list-style-type: none;
text-align: left;
left:3%;
margin-left: 0;
padding: 0;
position: fixed;
}
a {
text-decoration: none;
color: black;
color:red;
}
p {
top: 10px;
right:3%;
font-family: 'Akkurat';
position: fixed;
z-index: 2;
}
p.naam {
top:10px;
left:3%;
font-family: 'Akkurat';
position: fixed;
}
p.contact {
top:76%;
left:3%;
font-family: 'Akkurat';
position: fixed;
}
p.cv {
top:80%;
left:3%;
font-family: 'Akkurat';
position: fixed;
}
p.text {
margin-top: 106px;
right:3%;
font-family: 'Akkurat';
color:red;
}
</style>
This is how i want it to look when using the phone
https://jsfiddle.net/f51xjnzu/

Making the website responsive occurs mainly in the stylesheet (css), using % will help instead of px or em, wrap your elements in div containers to help keep elements align when accessed from a smaller device/screen.
You will have to resize certain elements or even hide them at specific screen sizes using similar code to below:
#media
only screen
and (min-width : 1024px) {}
Check this website for more details:
https://seesparkbox.com/foundry/structuring_a_responsive_stylesheet
Hope this helps, good luck!

Related

html website is overlapping and messing up on different resolutions such as mac etc

I am fairly new to coding and had to make a html website for uni, this ive tried position: absolute etc but still messed up any help please. sorry if ive done this question wrong or uploaded too much im new to this. Basically i want things exactly where i placed them but to resize on different devices and resolutions etc.
html { webkit-background-size: cover;
moz-background-size: cover;
o-background-size: cover;
background-size: cover;
}
/*this is the main title*/
h2 {
color: White;
font-family: optima;
font-size: 100px;
}
Ive tried commenting the code to help understand whats what.
/*this is for the logo*/
h3 {
text-align: center;
max-width: 100%;
}
/*this is the sub title*/
h4 {
color: White;
font-family: optima;
font-size: 20px;
border-width: 5px;
}
/*centering text for all pages titles other than contact us*/
.text-center {
margin: 0;
padding:0;
text-align: center;
position: absolute;
top: 50%;
left:50%;
transform: translateX(-50%) translateY(-50%);
}
/*centering text for contact us*/
.text-center2 {
margin: 0;
padding:0;
text-align: center;
position: absolute;
top: 30%;
left:50%;
transform: translateX(-50%) translateY(-50%);
}
/*icons to take you to other pages*/
.material-icons {
color: white;
font-size: 48px;
}
/* When moving the mouse over the button, adds tomato color */
.material-icons:hover {
color: tomato;
}
/*left text box title*/
.head-text h1 {
font-family: 'Roboto', sans-serif;
font-style: normal;
font-size: 25px;
margin: 0;
padding:0;
text-align: center;
position: absolute;
top: 10%;
left:7%;
transform: translateX(-10%) translateY(-10%);
color: White;
}
/*right text box title*/
.head-text h5 {
font-family: 'Roboto', sans-serif;
font-style: normal;
font-size: 25px;
margin: 0;
padding:0;
text-align: center;
position: absolute;
top: 12%;
left:70%;
transform: translateX(-10%) translateY(-10%);
color: White;
}
/*left text box on pages*/
.Body-Text p {
font-family: 'Roboto', sans-serif;
font-style: normal;
font-size: 20px;
top: 15%;
left: 1%;
width: 30%;
position: absolute;
z-index: 1;
visibility: show;
color: white;
border: 2px solid white;
background-color: grey;
}
You can use media queries to set different style rules for different resolutions.
Give this a read, hopefully it should help you understand how to implement them.
https://www.w3schools.com/css/css_rwd_mediaqueries.asp
To make an HTML page responsive(responsive means it works pretty fine and cool on all devices of all sizes). It is not possible by absolute positioning. 1) You have to use media queries [e.g. # media all width or e.g #import url("googleimage123.com")]
2) The language Bootstrap is used for this. Its just like HTml and css. With Bootstrap you can Build fast, responsive sites. Quickly design and customize responsive mobile-first sites.
Here are some links to learn these:
To learn Bootstrap: https://www.w3schools.com/bootstrap/
To learn to use Media Queries in Css: https://www.w3schools.com/css/css_rwd_mediaqueries.asp
To learn any computer/ programming language, or to get help regarding any issue related to them, I would prefer you to go along with w3schools.com
Good luck and have fun through your coding journey!

How can I get the spacing right please?

I'm not the greatest with HTML, but I'm also not the worse, as in I know how to locate and change things with instructions, but that's about it.
Is anyone able to help me please?
I am trying to get these two menu's separated/spaced out, ideally the main menu links to the left, and the social media links to the right, I have included two images below that hopefully explains what I'm looking to achieve.
This is how it looks on my site
This is how I want it to look
Hopefully I have put the right bit of code below, as I initially said I'm not great with HTML at all.
# 7. Navigation
-----------------------------------------------*/
#social-menu .social-links a {
color: $(topmenu.text.color);
}
#social-menu .social-links a:hover {
color: $(topmenu.text.hover.color);
}
.menu-wrap {
font-family: 'Poppins', sans-serif;
font-weight: 400;
font-size: 12px;
text-transform: uppercase;
letter-spacing: 2px;
width: 100%;
z-index: 7;
word-break: break-word !important;
-webkit-font-smoothing: subpixel-antialiased;
text-align: center;
}
#menu-secondary {
max-width: 1180px;
margin: 0 auto;
border-top: 1px solid;
border-bottom: 1px solid;
}
#nav-secondary {
margin-bottom: 50px;
}
#nav-primary {
position: static;
height: 50px;
background: $(topmenu.bg.color);
}
.wrapper-nav-primary {
max-width: 92%;
margin: 0 auto;
position: fixed;
width: 100%;
background: $(topmenu.bg.color);
padding: 0 4%;
z-index: 999;
}
#menu-primary {
width: 70%;
float: left;
visibility: hidden;
}
#social-menu {
float: right;
margin-top: 18px;
}
.menu-wrap .widget {
display: inline-block;
}
.menu-wrap li {
display: inline-block;
position: relative;
}
.menu-wrap li,
.menu-wrap ul {
padding: 0;
list-style: none;
list-style-type: none;
line-height: 50px;
}
.menu-wrap li a {
margin: 0 30px;
font-weight: 400 !important;
}
#nav-primary li a {
color: $(topmenu.text.color);
}
#nav-primary li a:hover {
color: $(topmenu.text.hover.color);
}
Thank you in advance.
My guess is that you can add the following to the #social-menu. If you can supply the HTML implementation, and not only the CSS it will be easier to determine.
position: absolute;
right: 0px;
Thank you both again for your help, I feel very silly as the solution was simply going to the Blogger layout section and simply moving a box!
I spent the whole of yesterday trying to sort this, following various tutorials and guides changing the HTML and adding CSS haha.
The red HTML/JavaScript box in the primary menu section should be in the social media section below

Page seems to be stuck in an specific height, I can't create more bottom space

I am trying to clone some website to improve my skills, but I have encounter a problem, the page seems to be stuck in an specific height and when I try to add more html it just disappear (it does not disappear, it's added at the top of the page behind the background image). I really want to know what is causing this and how to fix it without messing with the background image.
.center{
text-align: center;
}
*{
margin 0;
padding: 0;
}
a:link {
color: inherit;
}
a:visited {
color:inherit;
}
a:hover {
color: #ea7640;
}
a:active {
color:inherit;
}
a {
text-decoration: none;
}
#wrapper {
background-image: url("https://66.media.tumblr.com/f79df0dd538fc53292fe1aac7cd54daf/tumblr_oga789rskz1vxey6qo1_1280.png");
position: fixed;
top: 0;
left: 0;
min-width: 100%;
min-height: 70%;
background-repeat: no-repeat;
background-size: cover;
margin-top: 3em;
}
nav {
background-color: #312822;
padding: 3px;
margin-top: -8px;
margin-left: -8px;
margin-right:-8px;
font-size: 13px;
}
li {
list-style-type: none;
display: inline-block;
margin-right: 25px;
color: #bdb9b7;
}
#proyecto {
color: #ea7640;
}
.texto {
color: #ea7640;
font-weight: bold;
}
#logo {
margin-top: 4em;
}
#text{
margin-top: 4em;
font-weight: bold;
}
#marca {
margin-top: 10em;
font-style: italic;
}
#wrapper2{
position: fixed;
min-width: 100%;
min-height: 1000px;
background-color: #fff;
margin-top: 700px;
left: 0;
}
#wrapper2 ul {
margin-top: 20px;
}
Demo: http://codepen.io/njwda/pen/PbwaOV
Just erase position: fixed from your wrapper elements - that way the elements will simply appear below each other, as they are supposed to.
Your image has position: fixed, so the other content by default has property position: static and located under the image. If you want to see your new content, your should use one of the following properties for it:
position: absolute;
position: fixed;
position: relative;
For example try to add new <h1 style = 'position: relative;'>Test</h1> to your HTML.
Here is the working example: https://jsfiddle.net/o589ynts/
Good luck

Elements from same div overlapping on resize

I got problem with 2 elements from my header since 3 days,and cannot fix it.The problem is there that my "Search-trigger" which is my search icon and "tablet-icon" which is icon which is showing only on given browser width,are overlapping.Even search icon is going beyond tablet icon when browser is really tiny width.I tried with Float:right,leftand position:absolue,relative on both elements ,overflow:auto on site header,margin:left,righton elements and display properties on both elements display:block ,display:inline-block; Nothing works... i don't know where is the problem..
/***********************************************
Header Style
************************************************/
.admin-bar .site-header {
top: 32px;
}
.admin-bar .site-header.is-fixed {
top: -47px;
}
#media screen and (min-width:640px) and (max-width:790px){
.admin-bar .site-header.is-fixed{
top :-44px;
}
}
#media screen and (min-width:413px) and (max-width:783px){
.admin-bar .site-header{
top: 35px;
}
}
.site-header {
position: absolute;
top: 0;
left: 0;
right:0;
height: 80px;
z-index: 4;
border-bottom: 1px solid #eee;
}
/***********************************************
Search menu style
************************************************/
.search-trigger {
position: absolute;
right:0.5em;
top: 30px;
width: 40px;
text-align: center;
cursor:pointer;
cursor:hand;
display:inline-block;
}
#media screen and (min-width: 40em) {
.search-trigger {
right: 0.8em;
}
}
#media screen and (min-width:783px){
.search-trigger{
top:26px;
}
}
.search-trigger:before {
width: 100%;
display: block;
font-family: "ElegantIcons";
font-weight: normal;
text-align: center;
content: "\55";
/***********************************************
Icon Style
************************************************/
.tablet-icon{
position: absolute;
display:inline-block;
left:90%;
top: 23px;
width: 40px;
float:right;
}
.tablet-icon:before{
width: 100%;
font-size:1.6em;
font-family: "ElegantIcons";
font-weight: bold;
text-align: center;
content: "\61";
}
<header id="masthead" class="site-header" role="banner">
<span class="tablet-icon"></span>
<a id="search-trigger" class="search-trigger"></a>
</header>
That happens when you use position:fixed, position:absolut, and z-index. You have to change this in your media queries for each resolution.
When I have resizing issues I replace as many px sizings as I can with %. That way when the screen resizes, the elements resize proportionately. i.e. Change out things at 50px with 5%
Well i make the positions on my elements INSIDE the "" element to relative and float:right; and left my position of<header>to absolute,and it worked like a magic.

Css not being read WP

I know this is probably really easy, but I am just about ready to throw my laptop out the window with this...
I have been trying to make a bit of javascript work within my one of my web pages, but failing this I made a back up of my previous code and tried to restore what it was before... but it has completely messed up my gallery page (I haven't touched this page) and it isn't linking up with my CSS - I really don't understand it.
The images in the gallery are supposed to be horizontal not vertical.
Please help, I am very new to Wordpress and understand my coding may be amateur
Link: Gallery
/*
Theme Name: tigertone
Theme URI: http://tigertonestudio.com
Description:
Version: 1.0
*/
#clear {
clear: both;
}
body {
margin:0;
padding:0;
height: 100%;
background: url('images/bg.png') repeat;
text-align:left;
font-family: "Verdana", Arial, Helvetica, sans-serif;
font-size:.8em;
}
#brushblack {
background: url('images/brushblack.png') repeat;
height: 100%;
}
#header{
width:1000px;
height:118px;
margin: 0 auto;
padding:50px 0 25px 0;
clear: both;
}
#content {
font-family:'aller', Arial, Helvetica, sans-serif;
margin:0 auto;
width:100%;
padding:0;
text-align:left;
vertical-align: middle;
}
.blackcontent {
background: url('images/bgdark.png') repeat;
width:100%;
padding:40px 0;
height:100%;
overflow:hidden;
margin:0 auto;
vertical-align: middle;
}
.content{
margin:0 auto;
width:1000px;
}
.entry {
color:#000000;
}
.ngg-albumoverview .ngg-album-compact { float: left; margin-right: 20px;}
.ngg-gallery{
width:100%;
float: left;
}
.ngg-gallery-thumbnail-box {
width: 25% !important;
float: left;
margin-bottom:10px;
border:5px
border-color:white;
}
===================
Classes Page
===================
.classes {
margin-bottom: 75px;
}
.classes {
width: 450px;
float: left;
margin: 10px 8px 0 0;
}
.classes:nth-child(4n+4) {
margin-right: 0;
}
.classes a {
text-decoration: none;
}
.classes h2,
.classes .classes-bio h2 {
font-weight: 700;
font-size: 1.5em;
text-transform: none;
margin: 15px 0 5px 12px;
}
.classes .classes-bio p {
color: #666;
line-height: 21px;
margin: 0 70px 18px 70px;
}
.classes .classes-bio p strong {
font-weight: 700;
}
.classes a.read-more {
color: #D1883E;
display: block;
margin: 12px 0 0 0px;
}
.classes a.read-more:hover {
text-decoration: underline;
}
.classes .classes-bio {
position: fixed;
width: 600px;
height: 90%;
display: none;
z-index: 9998;
padding-bottom: 10px;
background-color: #eaeaea;
}
.classes .classes-bio .close-button {
position: absolute;
top: -17px;
right: -17px;
z-index: 9999;
cursor: pointer;
}
.classes .classes-bio img.profile {
width: 442px;
margin: 25px 181px 8px;
}
.classes .classes-bio h2 {
text-align: center;
margin-bottom: 6px;
}
.classes .classes-bio {
font-size: 1.1em;
margin-bottom: 28px;
}
.classes .classes-bio p {
font-size: 0.9em;
color: #000;
text-align: center;
}
.mask {
position: absolute;
left: 0;
top: 0;
display: none;
z-index: 9997;
background-color: #000;
}
HTML:
<h1>Gallery</h1>
<div class="ngg-gallery">
<div class="ngg-galleryoverview">
<div class="ngg-gallery-thumbnail-box">
[nggallery id=1]
</div>
</div>
</p>
</div>
Line 396 of style.css has a missing }, could be causing your issues.
There are some un-commented comments in there too...
===================
Classes Page
===================
(and the other ones like it) Should be like this
/*
===================
Classes Page
===================*/
There is a part in your styles.css file that is listed like this:
a:link{
font-color:#000;
a:hover{
color:#D1883E}
It looks like you are missing a closing bracket after the first a:link style block.
Looks likes there's a problem with your global.js file. The jQuery library which comes with Wordpress is in no-conflict mode, which means you can't use the $ sign. Solution is to surround the code with
jQuery(document).ready(function ($) {
So, in your case, change the global.js file to:
jQuery(document).ready(function ($) {
$('.classes a').click(function(e) {
e.preventDefault();
// Get the dimensions of the user's screen
var maskHeight = $(document).height();
var maskWidth = $(window).width();
// Set the mask overlay to fill the entire screen
$('.mask').css({'width':maskWidth,'height':maskHeight});
// Fade in the mask overlay
$('.mask').fadeTo(600, 0.7);
// Get the dimensions of the user's browser
var winHeight = $(window).height();
var winWidth = $(window).width();
// Set the bio pop-up to be in the middle of the screen
$('.classes-bio').css('top', winHeight/2-$('.classes-bio').height()/2);
$('.classes-bio').css('left', winWidth/2-$('.classes-bio').width()/2);
// Fade in the bio pop-up
$(this).parent('.classes').find('.classes-bio').delay(610).fadeIn(600);
});
// Click the mask or close button to fade out the pop-up and the mask
$('.mask, img.close-button').click(function(e) {
$('.classes-bio').fadeOut(600);
$('.mask').delay(610).fadeOut(600);
});
});
See more here
I don't know if it will solve your problem, but you could give it a try!