0

i'm trying some css test on my project, but one of my component don't want to show his css.

This is my Angular structure : Angular project structure

my app.component.html

<div id="nav-bar">
  <div id="nav-bar-content">
  <div id="nav-bar-left">
  <div>Pangolin</div>
  </div>
  <div id="nav-bar-right">
  <div>Register</div>
  </div>
  </div></div>

<router-outlet></router-outlet>

my app.component.css

#nav-bar {
  border: solide 5px red;
 
}

my app.component.ts

import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'socialnetworkapp';
}

and this is what i have in my browser :

navbar display

and this is my app.module.ts

// built in
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import {MatButtonModule} from '@angular/material/button';
//component import
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { UserComponent } from './components/user/user.component';
import { LoginComponent } from './components/login/login.component';
import { AccountComponent } from './components/account/account.component';
import { PageOneComponent } from './components/page-one/page-one.component';
import { navbarComponent } from './components/navbar/navbar.component';
import { SignUpComponent } from './components/sign-up/sign-up.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';




@NgModule({
  declarations: [
    AppComponent,
    UserComponent,
    LoginComponent,
    AccountComponent,
    PageOneComponent,
    navbarComponent,
    SignUpComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    FormsModule,
    HttpClientModule,
    MatButtonModule,
    BrowserAnimationsModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

My /src/app/components/page-one module works perfectly. Is it some children, parents issue there ? I'm new on Angular

1 Answer 1

0

Your CSS is incorrect, solide should be solid:

#nav-bar {
  border: solid 5px red;
}

See MDN border-style for a full list of valid border styles.

Sign up to request clarification or add additional context in comments.

3 Comments

my bad, yes your right, but event with solid , my css isn't display
In your browser's dev tools, if you inspect the nav bar element, what do you get?
i have no errors, i can see my navbar and my Ids, but i have no css style. For exemple for my <div id="navbar"> i only have div { display:block }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.