this is the first ever website I am building from scratch and I am definitely jumping right in head first. I managed to get my index page complete and really like the buttons that I have for the navigation. The problem I am running into is the sizing. Everything on the index page is exactly how I want it, but when going to any other page the header becomes larger than what it is showing on the index and larger than what I want. I am new to scripting and still learning. Any help is appreciated!
I have tried messing with the sizes, margins, and padding of nav in .css but once things start going well on the pages I am trying to fix, it is affecting the index. I also tried messing with the formatting of the photo on the index page, but nothing I am doing seems to be doing the trick and searching for help is not getting me anywhere as I am not using query or react, etc.
I have thought about creating a separate div tag for these pages but that seems inefficient and uncommon in navigation tags!
Files > https://github.com/sumbernotas/Portfolio
<header>
<h1 class="logo">SB</h1>
<nav>
ABOUT
PROJECTS
CONTACT
</nav>
</header>
nav {
text-align: right;
width: 99%;
height: 90px;
margin: 20px;
padding-right: 15%;
position: absolute;
top: 20px;
}
nav a {
display: inline-block;
padding: 0.5em 1.7em;
margin: 0 4.2em 0.1em 0;
border: 0.16em solid rgb(46, 196, 182);
border-radius: 2em;
box-sizing: border-box;
text-decoration: none;
text-align: right;
font-family: "Futara";
font-weight: 300;
font-size: 30px;
color: #7B7B7B;
text-shadow: 0 0.04em 0.04em rgba(123, 123, 123);
transition: all 0.2s;
}
nav a:hover{
color: #FDFFFC;
background-color: #2EC4B6;
}
Related
Although sometimes a pixel here or there must be forgiven and forgotten.
But in this example this simple menu's need to be rendered pixel-perfectly!
That is to say, the gaps between the menu items must be exactly equal.
In my example all menu separators looks ugly and fuzzy and disoriented as some items melt together.
While others are too far apart. Its a mess. After a nights sleeping,
I have come to the conclusion that this is one of those scenario's where the life's motto
of accepting whatever comes at you cannot be accepted and a designer must take a stand.
Whether its a dashed or solid line, the problem occurs in each and every whay I approach it.
setting margins to -1px and adding a border of 1px does not fix this.
Both examples are made from the newest version of Chrome and Firefox in 2022.
Is there a way we can separate the items with an equal, exact pixelated/aliased sharp line, without the vague anti-aliased fuzzy line of seemingly random thickness to happen?
You are allowed to rewrite it entirely or use flexbox or any other elegant CSS solution!
..............................
nav ul{
list-style: none;
margin: 0;
padding: 0;
}
nav {
top: 0px;
left: 0px;
position: absolute;
height: auto;
display: inline-block;
font-style: italic;
font-size: 1.25em;
padding: 0px 0 0 0;
}
nav li {
background-color: blue;
writing-mode: vertical-rl;
transform: scale(-1);
line-height: 1em;
border-top: 1px dashed white;
}
nav li a {
display:block;
text-decoration: none;
color: #fff;
padding: 2em;
}
<nav>
<ul>
<li>Bureau</li>
<li>Projecten</li>
<li>Diensten</li>
<li>Ontwerpen</li>
<li>Concepten</li>
<li>Kunsten</li>
</ul>
</nav>
Borders can be fiddly when you start applying transforms to the element they are applied to, so remove the transform:scale(-1) from the containing <li> elements and transform the <a> instead:
nav li {
background-color: blue;
writing-mode: vertical-rl;
line-height: 1em;
border-top: 1px dashed white;
}
nav li a {
display:block;
text-decoration: none;
color: #fff;
padding: 2em;
transform:rotate(180deg); <- other transforms are available :)
}
Snippet here based on your code: https://codepen.io/29b6/pen/KKQZywz
I have a problem. I suspect that the problem is a browser-side rendering problem. Maybe even an expectable behaviour, but I have no idea, and that is why I am going to ask you:
I have an <a>-element and I place two other elements (a <span> and a <div>, the <div> has even more children) inside that element.
I upload my HTML-file to my server and can access and download it (e.g. via curl or wget). There is no problem and the file is exactly the same. When I open it in web browsers (I tested Firefox and Chrome) it is still the same, but only when I open it using the "debugging" tab where I can see the original files. The displayed HTML-file (which I can access using the "inspection" tab) is different. The <div>-element got moved out of the <a>-element. Here is the code-snippet:
<div class="navbar">
A link
<a class="dropdown">
<span>A dropdown</span>
<div class="dropdown-content">
Another link
And a third link
</div>
</a>
</div>
As you can guess, it is a snipped from a navbar ;) Maybe you need the CSS (I use SCSS-files) too:
.navbar {
background-color: $navbar-color;
overflow: hidden;
padding-left: 10vw;
padding-right: 10vw;
a {
position: relative;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
color: $navbar-text-color;
}
a.dropdown {
position: static;
display: inline-block;
span::after {
content: '\f0d7';
font-family: FontAwesome;
padding-left: 6px;
}
.dropdown-content {
display: block;
position: absolute;
background-color: $navbar-color;
min-width: 160px;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
a {
float: none;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
color: $navbar-text-color;
}
}
}
}
I know, the design is not perfect and not finished, but I expect I am facing an HTML problem and so I wanted to ask you first.
Do you have any hints, ideas, references, explanations or corrections for me? I would really appreciate it.
I'm designing a website, I'm not a professional at css, but it's looking good so far, this is my button, Buttonyou see how the three words are split on separate lines? It makes the button taller then I wanted it to be, and it doesn't look nice and makes the site look weird with the rest of the buttons, I want all the words spread on 1 line, making it longer horizontally, rather than vertically,
HTML:
.game1 {
border: none;
/*background-color: #f5f5f5;*/
background-color: #9c9c9c;
padding: 14px 100px;
font-size: 16px;
cursor: pointer;
display: inline-block;
margin-top: 400px;
margin-left: -100px;
}
body {
background-color: #051321;
}
<button class="game1 success">Taken From Home</button>
Before you mark me as duplicate: I've read all the similar questions and tried the solutions and either I'm too dumb to understand them (a valid possibility), or my problem is different, but they didn't work for me.
I was marked off-topic on wordpress forum since it is apparently a css/html problem, so I reposted here.
Now on to the problem:
I'm having trouble with removing the underlines of some links I have on my site. Here's my html definition of the links:
<p style="text-align: center;">
<a class="buttonL" href="http://cns.uni.lu/homel"><</a>
<a class="buttonR" href="http://cns.uni.lu/homer">></a>
</p>
And my CSS from the "custom CSS" page:
.buttonL {
border-radius: 50%;
position:fixed;
top: 50%;
left: 0%;
background-color: transparent;
border: none;
color: grey;
padding: 5px 20px;
text-align: center;
text-decoration: none !important;
display: inline-block;
font-size: 50px;
margin: 4px 2px;
cursor: pointer;
font-weight: 900;
}
.buttonR {
border-radius: 50%;
position:fixed;
top: 50%;
right: 0%;
background-color: transparent;
border: none;
color: grey;
padding: 5px 20px;
text-align: center;
text-decoration: none !important;
display: inline-block;
font-size: 50px;
margin: 4px 2px;
cursor: pointer;
font-weight: 900
}
I know it's redundant and inelegant. No use commenting on that. I can make it more elegant later.
For some reason, there is a line underneath the links, that won't go away. I've tried using
text-decoration:none !important;
, but to no avail. I've applied it on .buttonL, .buttonR, a, .buttonL a, .buttonR a, .buttonL:link, .buttonL:active, .buttonR:link, .buttonR:active, .buttonL a:link, .buttonL a:active, .buttonR a:link, .buttonR a:active.
I've also tried doing
border-bottom: none;
and
box-shadow: none;
, also to no avail.
Any ideas as to what I'm doing wrong?
P.S. I can't link the page I'm referencing, as it is on an internal network. Sorry...
Here's a screenshot of the page:
The links in question are the arrows to either sides. Although the other links have the same problem.
Use This CSS may be help you thanks
body .buttonL, body .buttonR {
text-decoration: none !important;
}
OR USE THIS
body a{
text-decoration: none !important;
}
I just found the solution:
For some reason the background gradient (although it was white) left a line at the backgrounds border (or center - I'm not sure). To remove this, I added
.entry-content a{background-image:none;}
to the css file, instead of just making it transparent.
Thanks for all the help :D
If the css is not working means then use jquery
<script>
$(document).ready(function(){
$('.buttonL').css('text-decoration','none');
$('.buttonR').css('text-decoration','none');
});
<script>
I hope this will solve your issue.
I am trying to to position some related icons above my main nav. Essentially what am I am trying to accomplish is to have the text and icon change to a different color when the user hovers over the appropriate area (the tag with large padding). I am having problems accomplishing that.
My thinking is that it would be easiest to do it with icon fonts, but they are inline only. I then tried to make a new with the icon fonts and position them above the man nav, but then I couldn't figure out how to get it to change colors when the user hovered over the designated area.
I also tried the rollover method, which I couldn't get to work, because when I made a class in the tag and changed the display to block, it threw my nav off. My code:
<ul id="nav" role="navigation">
<li>EXCERPT</li>
<li>ABOUT</li>
<li>CONTACT</li>
</ul>
#header {
overflow: hidden;
background-color: #F5F5F5;
border-bottom: 2px black solid;
position: relative;
}
#nav {
float: right;
position: absolute;
bottom: 0;
right: 0;
margin: 0 0 10px 0;
}
#nav li {
list-style: none;
display: inline;
font-size: 2.5em;
letter-spacing: 0.1em;
font-family: 'OstrichSansMedium';
}
#nav a {
text-decoration: none;
color: #C4C4C4;
padding: 200px 20px 15px;
}
#nav a:hover {
color: #000000;
background-color: green;
}
I was going to do a fiddle for you but jsfiddle is down for maint. You're going to have to use a little bit of script to handle a complex bar with images, etc. Sprites are very nice and effective but again you'll need at least a few lines of script to support it
Take a look at the source of the tabs on jQueryUI. The structure you have above is nothing more than a tab bar.
Look at this site too. Live Example The top navigation is all done with images, CSS and a tiny bit of jQuery. Grab the source on this one too so you can view it any time.